Quickstart-ios: FCM says token is valid/request success after app is uninstalled

Created on 27 Sep 2017  路  10Comments  路  Source: firebase/quickstart-ios

I was testing the push notification tokens, and I uninstall the app from the device after token was generated. Then I tried to send push notification with that token which I expect to be invalidated/unregistered. However, I'm still getting a success message with that token.
When will tokens get invalidated after uninstall? I don't want the server to keep sending the request if the token is no longer valid.

Most helpful comment

Hey @ordinaryman09, sorry for the late response.

Instance IDs will become invalidated _eventually_ after an uninstallation. There's no callback on iOS on app uninstalls, so there's no way for us to invalidate every token immediately upon uninstall.

If you find that your tokens are unusually long-lived, please file a support ticket and we'll take a look.

All 10 comments

Hey @ordinaryman09, sorry for the late response.

Instance IDs will become invalidated _eventually_ after an uninstallation. There's no callback on iOS on app uninstalls, so there's no way for us to invalidate every token immediately upon uninstall.

If you find that your tokens are unusually long-lived, please file a support ticket and we'll take a look.

Hi

I am also having the same issue as @ordinaryman09. When you say "eventually", what does that mean? Is that days, months, years? Can you please clarify ?

I don't have an exact number, but I'll update this issue once I find out.

Hi @morganchen12,

In iOS, when I Uninstall a app, eventually the Token will be invalidate.

But who is the responsible for this invalidation, some Google service, or Apple service?

FCM is responsible for invalidating the InstanceID token. Apple is responsible for invalidating the APNs token.

Is There anything we can detect for android??

hi @kroikie do you have any link for that information?

So if apple invalidates APN token will that also result to FCM invalidating its instaceID token?

@deejaygeroso The instance ID token is mapped to an APNs token so if the APNs token is invalidated then you will get a new Instance ID token that is mapped to the new APNs token.

docs

@cw-udaysolanki if your Android Instance ID token is invalidated then you should get a callback in the onNewToken method, if you initially handled the original token then handling the updated token should not require any additional steps.

To clarify, FCM sends to iOS devices will succeed if the APNs token has not yet been invalidated. Following an uninstall, APNs token invalidations are non-deterministic and are handled by iOS (see this thread for more details).

Otherwise, a send to the FCM token (with invalid APNs token) will cause the FCM token to be invalidated as well.

@kroikie @morganchen12

Thank You for the information.

I did test it, created an app and created an FCM token then uninstalled the app, and somehow it took a couple of days before APN/FCM token got invalidated. For android FCM token got invalidated immediately.

Was this page helpful?
0 / 5 - 0 ratings