For our Live Activity Tokens, when we fire a payload, often apns is returning a response of 410 unregistered.
Docs are saying:
The device token is inactive for the specified topic. There is no need to send further pushes to the same device token, unless your application retrieves the same device token, refer to Registering your app with APNs
Questions:
-
Why does this happen? Does it only happen because the user changed their permission? Or there are other reasons?
-
And when it does happen, what should we do about it?
A. Should we keep the token on the server? Because perhaps the user will change their permission and the token becomes valid? That could leave us with lots of invalid tokens and us firing at them unnecessarily.
Docs do say:
Don’t retry notification responses with the error code BadDeviceToken, DeviceTokenNotForTopic, Forbidden, ExpiredToken, Unregistered, or PayloadTooLarge.
B. Or should we remove the token from the server? That then requires app to re-register the token. But the problem with that is:
When I went into App's settings from OS settings and toggled push notifications to on, the app was not launched into the background nor killed i.e. it requires explicit app launch by the user to re-register itself which isn't ideal...
It means a user may turn on notifications from the OS settings and then assume that their push notifications should be back in business, but that won't happen if you toggle things from OS settings.