50ButtonsEach/flic2lib-ios

Terminated app does not wake up on button click.

Closed this issue · 5 comments

I'm attempting to wakeup a terminated app when my FlIC button was clicked, but that doesn't seem to be happening. The button works when the app in background as expected, just not terminated.

I noticed that in the documentation it mentions this is possible, but I also notice there's a discrepancy between flic libs. the documentation i'm reading requires an app key and secret, and is called "SCLFlic".

Emill commented

What do you mean by "terminated"? Yes if you swipe-kill it, then yes iOS won't let the app do anything anymore, and we can't do anything about that.

On the other hand, if you just leave it in the background without touching it, the system will eventually terminate it if it's not used for a while, but the system will automatically, when the button sends an event, restart the process and the Flic connections can be reestablished, in a way that the user didn't even noticed it was terminated for a while. This is something Apple calls "state preservation and restoration".

So a terminated app, "swipe-kill" can not be brought back without the user?

Emill commented

Correct. If you "swipe-kill" an app, you must manually launch it again.

Is there no app that is able to be open in the background via bluetooth? Do music apps not achieve these things either? I definitely thought this was a possibility.

There are definitely ways to wake up the app again. It depends on the use case of the app what will be approved by Apple though.

For example we have an app which tracks your location. The app will, even when terminated, wake up through the significant location change api. The geofencing api also offers a likewise wake up method.

However if you do not need to track location for your app, it will be very hard to have flic work correctly when user swipe-kill the app.