APNs behavior when deleting apps

I have a question about APNs specifications.

We are aware that if we delete the app, we will disable the device token managed by APNs. we intend to send a push notification from AWS SNS to APNs and if the device token is disabled, AWS SNS will identify that the app has been deleted from our phone.

I believe the specification is that iOS uninstall data is only available after the 8th day. However, it has been a month since the uninstallation and still the APNs are not returning the device token as invalid.

Why is the uninstall data not available?

If there is a way to do this waiting up, please let me know.

Replies

There is no such thing as "iOS uninstall data". Furthermore there is no such timing as this non-existent data appearing after the 8th day. Wherever you may have obtained this information from must be confusing the Status/Error 410 (Unregistered) return to mean the app has been uninstalled.

The 410 status was never meant to be a signal for developers to determine that the app has been uninstalled. It is actually a signal to the push provider server that they should stop using that token. Although this could mean that the app may have been removed, it could also mean the token has changed while the app is still installed. The app token may change due to certain system events. Deleting and reinstalling the app, restoring the device from a backup, resetting the device (and then installing the app), certain major iOS updates, transferring all apps and data to a new device are all events that will cause the token to change. Because of this, it is recommended that apps register for remote notifications at every launch. If the token has changed, the app would need to update the push server to use the new token for the device/user. If an existing token is receiving 410, it might be that the app is still installed but one of these cases occurred.

Indeed if you look at the description of the 410 status, it says "The device token is no longer active for the topic.". Topic, in most cases means "your app". It is an indicator of the state of the token, not the app. And trying to determine whether an app has been deleted or not, based on the 410 result is an off-label use that would not guarantee the results you might expect. Additionally, beginning the return of the 410 state is non-deterministic for the sole purpose of discouraging this interpretation.

To summarize this interpretation: Existence of a 410 status merely indicates that the token is no longer valid and should not be used anymore. It does not mean the app has been deleted. Nor, the lack of a 410 status mean the app is still installed and receiving notifications. If it is important to your use case that you know notifications are being received, my suggestion would be to confirm the critical receipt of notifications via a service extension, or based on user interaction to indicate that the user has actually seen the notification, not just that the device has received it (for example, the phone sitting at bottom of a bag with mute switch on).

If you receive a 410 status for a token, you should stop using it. If you believe that the app has been removed but still receiving 200 status for the token, there is no harm in sending notifications to it until if and when you receive a 410.

  • @Gualtier Malde if the token changes, lets say due to the user backing up then restoring, but the user doesn't launch the app, then the app now has a new token but as it hasn't run it won't have the chance to inform the server there is a new token, hence all the pushes will fail. Is there any solution for such situations?

  • At this time there is no solution for such situations if the app is not commonly launched by the user.

Add a Comment