In the latest application update we’ve provided users with ability to receive live updates for Football matches using Live Activities. Our application supports up to 5 simultaneous activities (one per match) and all the updates can be provided exclusively with ActivityKit push notifications. The average frequency of updates is about 10 per hour.
Mostly all the notifications can be received and handled properly on the client side, but in some cases Live Activity “get frozen” and no updates can be delivered for such Activity anymore. The key point here is that our Push Notification Server continues to send relevant match updates to APNS and receives 200 OK response but for unknown reason the notifications never get delivered to the client. Another detail to be mentioned is that we use traditional Push Notifications alongside with Live Activities and they work as expected without any troubles.
We’ve conducted a detailed analysis of the problem, read all available documentation but still couldn’t resolve the issue. The first thing we tried - adding NSSupportsLiveActivitiesFrequentUpdates entry to Info.plist. Thereby frequentPushesEnabled are constantly enabled and never turned off. Another trick we applied was setting apns-priority HTTP header for our requests to APNS. We have tried priority of 10 for important Live Activity updates and 5 for secondary ones in many different combinations.
All the described solutions were found in the Official Documentation.
During all the tests Low Power mode was disabled, Live Activities when iPhone is locked were allowed.
It’s worth to be mentioned that when the updates our Push Server sent to APNS weren’t delivered to iOS client, we tried to perform exactly the same request from our local machine. In this case APNS delivered the ActivityKit push notification immediately although Live Activity token and push payload were exactly the same.
According to this document, our push server generates new token to access APNS every 40 minutes, so reaching APNS with the expired JWT is probably not the case neither.