I've read a lot of articles about Firebase Instance Id
and registration token
here, here and here.
I have some confusions about their scope and relationship between Instance Id
and Token
. I would like to validate that my understandings are correct or wrong.
Instance Id
is generated per App. Not per installed device. For example, if you have Mail app and Notes App, you will have two Instance Id on firebase.Token
is generated per installed devices. For example, if you have ten users installing your app, you will have ten registration tokens.Instance Id
will have many registration tokens.registration tokens
(not Instance Id) on our App Server to send push notifications.Firebase Instance ID provides a unique identifier for each app instance and a mechanism to authenticate and authorize actions (example: sending FCM messages). Instance ID is stable except when: App deletes Instance ID. App is restored on a new device. User uninstalls/reinstall the app.
The Instance ID API lets you integrate Instance ID with your Android or iOS app. Instance ID provides a unique identifier for each instance of your app and a mechanism to authenticate and authorize actions, like sending messages via Firebase Cloud Messaging.
To retrieve the FirebaseInstanceId you need to implement the Firebase In-App messaging SDK and make sure your app connects to Firebase. Once the app is connected to Firebase it will add the FirebaseInstanceId to the Android log once the App is run.
Partly correct. An InstanceID pertains to the app instance. In your example, if you have the Mail App and the Notes App, each has their own instance id, but the two are not the same, so they can't be grouped together.
Think of the app instance as the app installation. If you have installed the app on the device, it has the app instance. If you uninstall it, it is also removed, if you re-install it, it's a new app instance.
Correct. But there's also a possibility to have multiple tokens for the same device, but this only pertains to having multiple senders.
Possible. See #2.
Yes. The registration token is the value needed as a target for push notifications.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With