Search code examples
iosobjective-ccocoa-touchkeyboardios-extensions

In custom iOS keyboard detect the app


How to detect in which app my custom keyboard used and show different button? E.g. in Twitter I would add @ to string I post into input field and in Reddit /r/


Solution

  • Edit: See above. Things have changed.

    This is not possible. An extension runs sandboxed and is only fed information from the API and cannot access anything else. The keyboard can only receive text context changes and activate/deactivate calls. Being able to detect an app lies outside of the extension sandbox and therefore is impossible.