Background / Terminated FCM / APN Notifications on iOS

101 Views Asked by At

We've been developing a Flutter App for some time now and recently implemented it in iOS, since a portion of our users use iPhones.

The app relies heavily on real time messaging and live synchronisation, through a mixture of WebSocket connections while the app is active, and FCM to APN integration whilst the app is suspended but not terminated.

Side information: All tests were conducted using TestFlight, so if anything is different with TestFlight apps than normal apps regarding activity life cycle, information would be appreciated.

Now the issue we have, is that Apple imposes significant constraints on apps running on their operating systems, namely:

apps that are in background for long enough will be suspended and more importantly

apps that are closed, aka terminated, will never be reactivated through code alone, and can therefore not even receive APN data parcels. My question is twofold:

since some apps (notably WhatsApp) seem to easily get around this issue, which can be proven by terminating the app, receiving the notification, disabling any internet communication means, and then opening the app and noticing that the message is there. How would a developer of a realtime messaging application do something like that, as it is crucial for our development. secondly, what exactly are the requirements for the iOS to terminate a background suspended app, causing APN to stop looking for parcels to this app? How to extend the lifetime or something similar. I know many developers around the world face issues about exactly this issue, especially coming from a platform like Android.

Any help is highly appreciated, so thank you all in advance.

0

There are 0 best solutions below