When Device Token Expires, Is It Automatically Removed From Fcm Device Group?
I'm pretty new to Firebase Cloud Messaging, and I haven't been able to get a satisfactory answer to this question yet (also, sorry for. all the full. stops, unfortunately I bought
Solution 1:
As far as I know tokens are not automatically removed from a device group when they expire. You will have to do that in your app server code.
If you have the old token, you can do that immediately when the token is refreshed.
Alternatively you can detect outdated/expired tokens when sending a message, and remove them then. For an example of this, see this code that sends messages using the Admin SDK.
Solution 2:
The registration token may change when:
- The app deletes Instance ID
- The app is restored on a new device
- The user uninstalls/reinstall the app
- The user clears app data.
Previous token become invalid after generation of new token, good approach is to update access token on each login and remove token on each logout, by doing this you will always get the updated token. For more understading
https://firebase.google.com/docs/cloud-messaging/android/client#sample-register
Post a Comment for "When Device Token Expires, Is It Automatically Removed From Fcm Device Group?"