简体   繁体   中英

How can I know that a Firebase Cloud Messaging token is out of use?

A single user can have multiple devices connected to his account. Because of that he can have multiple cloud messaging tokens. Everytime the user opens the app the token from that device is send to the app server and saved there.

What happens if a user uninstalls the app from one of his devices? I have no chance to tell the server that the token is not longer in use. Can it occure that I notify an other user instead since this other user has acquired the not longer used token from the original user?

What happens if a user uninstalls the app from one of his devices?

Usually, when your app is uninstalled, it is advisable for you (the developer) to automatically make sure that the corresponding registration token is deleted from your own App Server.

Can it occure that I notify an other user instead since this other user has acquired the not longer used token from the original user?

No. Each registration token is unique per each app instance. So rest assured that if a registration token is invalidated/expires for whatever reason, no other user will be able to use it. Sending a message to an invalid/expired registration token will result to a NotRegistered error.

Tokens are not re-used so there should be no risk of notifying another user. Tokens cannot be acquired by one user from another.

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