Since iOS doesn’t allow for free multi tasking, this will be one way to communicate with an app while it sits in the background.
I asked chatGPT how could this be achieved:
Scenario: App wants user to sign a Nostr note
• App A sends an unsigned note into a system text field (or copies to clipboard).
• User switches to the custom keyboard.
• The keyboard recognizes the unsigned note format (e.g., JSON/NIP-01 structure).
• Keyboard writes the note into a shared container.
• Main app is notified (e.g., via background fetch / polling / shared flag).
• Main app signs the note and writes it back to the shared container.
• Keyboard reads the signed message and injects it back into the text field.
Seems very possible to me. 😅