简体   繁体   中英

How to get the token id for FCM for the device which uninstall the application?

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.

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 .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM