Alvin
Alvin

Reputation: 8499

How to store firebase instance id token?

Is firebase token is use to sent to specific device?

How do I store firebase token in MySQL?

From google website, It does not mention about the length of the token.

It seems to be very long.

Upvotes: 0

Views: 6272

Answers (1)

Frank van Puffelen
Frank van Puffelen

Reputation: 598668

An Instance ID Token identifies a specific app on a specific device. From the Firebase documentation:

Registration token - An ID generated by the FCM SDK for each client app instance.

The Instance ID Token indeed only expires in very few conditions. Also from the documentation:

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.

The token is a relatively long string. Since you're unlikely to frequently search for it, I'd store in in a text field in your database.

Upvotes: 4

Related Questions