2

I have an iOS custom keyboard that send input texts to its container app, which process them into predictions and send them back to the extension (keyboard) for the user.

In this situation, the container app can run in background for 180 seconds and still catch the inputs. This time elapsed, it goes to suspended mode and the keyboard cannot receive the predictions anymore.

What I've tried so far :
- Silent push notifications : could work but the user needs network. I don't want that.
- Background fetch : it is not sure that the container could wake up immediatly.
- Local notifications : I don't want the user to open the container in foreground. It must remain discreet.
- URL schemes : works but open the app in foreground. Not ideal.

Constraints :
- No network.
- The user should not have to open the container himself.

Concrete case :
- SwiftKey actually does that without user interaction nor network. I can't figure it how...

My question is : is there a way to wake up the container silently while the user is typing from the extension ? Or make the background task running forever ?

Thanks for reading.

Cisoun
  • 31
  • 3
  • the only way you can wake up your 'container-app' directly is to use _URL-schemes_, but that is not silent at all, it opens your core-app – if you need to use any feature of your core-applications in your extension without lunching the cope-app, then you must embed those features into your extension directly. – holex Feb 23 '18 at 10:07
  • Thanks for your answer. I forgot to add that I've already tried the URL schemes and as you said, it is not silent. I've already tried to embed the predictions system in the extension. It works on some devices but I had a few users reporting crashes on their devices due to memory restrictions (or iOS being too restrictive). That's why I moved these features container side (like SwiftKey). – Cisoun Feb 23 '18 at 10:26
  • Why you want to wake up the Core App. Just share the code between the app and app extension. The App extension can do the processing. – Sachin Vas Feb 23 '18 at 12:13
  • Memory constraints. Lightening the extension makes it smoother at usage. Moreover, porting predictions container side allows running more features with less limitations. It seems technically possible and Apple allows it, so, why not ? By the way : I already have a version which runs extension side but I got troubles with some iPads. I've got two of the same model. One did the job pretty well, the other made the extension crash. Running the predictions container side solved this problem. – Cisoun Feb 23 '18 at 13:59

0 Answers0