Having some discussion about when we should clear out a token from our servers.
Docs say:
Don’t retry notification responses with the error code
BadDeviceToken,DeviceTokenNotForTopic,Forbidden,ExpiredToken,Unregistered, orPayloadTooLarge. You can retry with a delay, if you get the error codeTooManyRequests.
The way I see it is that with the exception of PayloadTooLarge, all other errors means you should remove the token from your server. Either because:
- The token is no longer good
- The token is good, but this is just not the right:
- environment (sandbox vs production)
- topic (the token is from a different bundle id or developer team)
- target (app vs live activity appex)
Do I have it right?
Extra context: when using the "JSON Web Token Validator" tool, a colleague reported that a 410 -Expired token (from couple days back) was still valid today. This raises questions about when tokens should actually be deleted and how these error codes should be interpreted.
Also is it possible for the docs to get updated for us to explicitly know if a token should get removed and not leave it for interpretation?