Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

The scope of Firebase Instance Id and Token

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.

  1. 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.
  2. Token is generated per installed devices. For example, if you have ten users installing your app, you will have ten registration tokens.
  3. One Instance Id will have many registration tokens.
  4. Normally, we only have to keep registration tokens (not Instance Id) on our App Server to send push notifications.
like image 724
Steve.NayLinAung Avatar asked Jul 17 '17 08:07

Steve.NayLinAung


People also ask

What is instance ID in Firebase?

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.

What is app instance ID?

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.

How do I get Firebase instance ID in flutter?

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.


1 Answers

  1. 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.

  2. Correct. But there's also a possibility to have multiple tokens for the same device, but this only pertains to having multiple senders.

  3. Possible. See #2.

  4. Yes. The registration token is the value needed as a target for push notifications.

like image 110
AL. Avatar answered Oct 04 '22 11:10

AL.