कंसोल पर जाएं

FirebaseInstanceId

public class FirebaseInstanceId extends Object

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
  • User clears app data

Once an Instance ID is generated, the library periodically sends information about the application and the device where it's running to the Firebase backend. To stop this, see deleteInstanceId().

To prove ownership of Instance ID and to allow servers to access data or services associated with the app, call getToken(String, String).

Public Method Summary

void
deleteInstanceId()
Delete the Instance ID and the data associated with it.
void
deleteToken(String senderId, String scope)
Revokes access to a scope (action) for a sender ID previously authorized by getToken().
long
getCreationTime()
Returns time when instance ID was created.
String
getId()
Returns a stable identifier that uniquely identifies the app instance.
static FirebaseInstanceId
getInstance()
Returns an instance of this class.
static FirebaseInstanceId
getInstance(FirebaseApp app)
Returns an instance for the given FirebaseApp.
Task<InstanceIdResult>
getInstanceId()
Returns the ID and automatically generated token for this Firebase project.
String
getToken(String senderId, String scope)
Returns a token that authorizes a sender ID to perform an action on behalf of the application identified by Instance ID.
String