What I learned about FCM is that its token never gets expired unless;
- The app deletes Instance ID
- The app is restored on a new device
- The user uninstalls/reinstall the app
- The user clears app data.
I have provided a option to user to enable/disable notification, user clicks on disable and i send null
to server, and FirebaseInstanceId.getInstance().getToken()
when user enable push notifications
Now some times it sends the same token when user re-enable the notifications, and few times it changes the FCM Token
.
My Questions are:
- Why does it change the
Token
, when nothing of the 4 conditions mentioned above aretrue
, and if it's changing it randomly, then there is a chance that it changed the token at any point of time, and the server is sending the notification to the wrong Token. - I noticed that, if I clear data, and open the app, it hits for Token
registration and gets the same token sometimes does it store
udid
of devices, or what mechanism, by which it knows that it's the same device.