when data or notification is received inform server

I'm trying to achieve the functionality same like whatsapp, whenever message is delivered to the user the sender gets the double tick(Means message has been delivered). this works in all scenarios even if the app is killed.

I'm sending push notification with extra data(notification id) which will be saved whenever notification is received. so I can save and inform server about the notification delivery status.

for this I tried didReceiveRemoteNotification but it wont work always because once the app is killed (swiped from recent apps) than no more calls are going.

Can I know the method how whatsapp is achieving this. Is there any method by which we can get the status of notification delivery even when app is killed.

Answered by Engineer in 704828022

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 it will be executed even if the app is killed by the user, as long as the user has not disabled the visibility of your notifications through various settings.

Accepted Answer

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 it will be executed even if the app is killed by the user, as long as the user has not disabled the visibility of your notifications through various settings.

when data or notification is received inform server
 
 
Q