How can I keep my app up to date with the server without throttling

I am trying to build a chat app. I am using FCM to deliver messages to my app accompanied by some custom data like the new message_data, deleted message_id and so on; each message will need to run the app in the background to do some background processing and local database syncing.

This continuous background processing is clearly not acceptable as APNs imposes a per-device limit on background push notifications . I am asking how can I push messages and actions payload without being throttled ?

Background notifications to wake up your app to run some code will be throttled.

I suggest looking into using a Notification Service Extension as discussed at https://developer.apple.com/documentation/usernotifications/unnotificationserviceextension. The Notification Service Extension will be executed for every visible push notification. So, it could serve your needs, as long as the user has not disabled the visibility of your notifications through various settings. The service extension will not be executed for push notifications that will not be presented visually.

Although, the designed purpose of this expansion is to modify the incoming messages, so whether it will fit your use case or not, you will have to decide yourself.

The extension will be limited to 30 seconds and 24 MB total memory. You cannot directly communicate with your main app except via a shared container you can write and read. And you cannot send silent notifications.


Argun Tekant /  DTS Engineer / Core Technologies

What about when the user is offline ? All notifications are collapsed and only the last one is received. How can I receive all notifications and save them using the shared container ? What can I do to ensure that each notification gets delivered ?

I am trying to replicate WhatsApp's effect where all messages are delivered using notifications where as soon as a notification is received, the message is locally saved and don't need any On-App-Start re-syncing with server.

If there is another better way of achieving this effect, it would be much help.

How can I keep my app up to date with the server without throttling
 
 
Q