Correct way to handle iOS Push Notification with killed/swiped apps

336 Views Asked by At

After XCode 11 released Apple had restricted PushKit notifications. Now it can be used only to notify incoming call. So if app don't report incoming call via CallKit it will be crashed.

The question is how to organize push notification delivery to messaging app even when it killed.

I found some points which can be used - "silent notifications" (not PushKit) with specified push-message content (content-available=1, apns-priority=5, etc). App can handle push-notification, run some business logic to prepare message data and display UNNotification and/or update app badge.

But there are lot of posts and topics about iOS restrictions to push-notifications delivery to app killed by user - OS just doesn't launch app.

There is another plot twist - Telegram iOS source code shows exactly same application logic - PushKit notifications only to incoming calls and default PushNotifications to all other scenarios (by sources). You can kill Telegram app, but you always receive incoming message notifications - the application somehow has launched and is handling push-notifications (decrypt, load media and other).

How does it all work?

0

There are 0 best solutions below