0

I've been working on a FCM implementation and have noticed that a device token assigned to a an app installation, can live on even if the app is uninstalled.

Is there any way to know that token is technically no longer valid? So that I can delete the token from the AppServer.

AL.
  • 36,815
  • 10
  • 142
  • 281
Krish
  • 3,860
  • 1
  • 19
  • 32
  • Have a look at this [answer](http://stackoverflow.com/questions/17328654/do-old-gcm-tokens-live-on-even-after-an-uninstall/31828374#31828374)... – Baris Akar Jan 24 '17 at 09:22

1 Answers1

0

Handling what happens when the client app is uninstalled is entirely up to you.

The way I see it, you should simply detect when your app is being uninstalled, if it is, just send a request to your App Server to delete the registration token that is associated with the device (calling getToken() to make sure that the registration token you intend to delete is correct).

If ever a scenario comes in where you failed to delete registration tokens and your server somehow manages to send a message to it, I guess that's where Canonical IDs come into play.

You can also just check if a registration token from your Server.

Community
  • 1
  • 1
AL.
  • 36,815
  • 10
  • 142
  • 281