Android Question Firebase Cloud Messaging Update Push Subscriptions

Alexander Stolte

Licensed User
Good Day,

if a device is first time using the FCM in a App, then he create an Instance ID, with this ID he can subscribe for topics or you can send a push message to this device with this ID. The problem is, Over time, you subscribe to a heap of topics and this ID is not forever this ID is lost if you:

  • App deletes Instance ID
  • App is restored on a new device
  • User uninstalls/reinstall the app
  • User clears app data

and then you can't receive messages from these topics, because you have then a new Instance ID.

I found here maybe a solution, but i dont understand what is needed and if it is the right one.

My question is, is this the right one? and if yes how to configure it?

if not, what is an alternative, how can I save the subscribed topics?

This is a important question, because everyone is affected, I think that hardly anyone knows that the instance id is lost.



B4X founder
Staff member
Licensed User
Longtime User
This is a important question, because everyone is affected,
I don't think so. Most developers let Firebase handle the topics and don't use the token ids at all.

A possible solution is to always store the newest id and delete old ids after X days. If someone hasn't opened your app in 30 days then you should probably avoid sending them a message anyway.
Upvote 0