Push notification sent to uninstalled app

I am using push notification in my app. User token gets properly registered and is sent to server. Notification are also sent by server and recieved on device as expected.


The problem occurs when user uninstalls the app. iOS does not provide any option to handle uninstall event. On top of that when server send notification to such device token APNS feedback service sends success message. Meaning APNS sends push notifications to uninstalled app.


I have an API to unregister the device on server since no event is triggered I am unable to call it.


Please suggest a way out.

From Apple's dev team:


APNs will eventually report that the push token is invalid after an app has been uninstalled. The time between an uninstall and the invalidation is dependent on various factors, and the details of when this will happen is not documented.

The guidance here is to send the puhes to devices until you receive an error response from APNs. Sending pushes to non-existent apps does not cause any harm.


We have no recommendations for determining when users uninstall apps. Our current implementation is indeed designed to avoid such detection by developers, and as such, we have no services, API, or code samples to have alerts sent when an app is uninstalled.

Erick,


Where did you see this response? I've been working with our backend team to lower the ammount of stale APN registrations. I've been running tests recently that suggest registrations are sticking around for months after uninstalling the app. Even after I send multiple notifications to the stale device token APNS does not return the 410 status code.


Was this advice sent directly from the dev team?

Hi Erik,

This respones is helpful as I am lokign for the same thing, and this helps me avoid waste time. But could you also please cite the source of the statement you quioted from "Apple's dev team:". I was not able to find it in google search. The only other result was another reply from you: https://forums.developer.apple.com/thread/116543
Thanks

Push notification sent to uninstalled app
 
 
Q