java.lang.Object | |
↳ | com.google.firebase.iid.FirebaseInstanceId |
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:onTokenRefresh()
.
To prove ownership of Instance ID and to allow servers to access data or
services associated with the app, call getToken(String, String)
.
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Resets Instance ID and revokes all tokens.
| |||||||||||
Revokes access to a scope (action) for an entity previously
authorized by
getToken() . | |||||||||||
Returns time when instance ID was created.
| |||||||||||
Returns a stable identifier that uniquely identifies the app instance.
| |||||||||||
Returns an instance of this class.
| |||||||||||
Returns an instance for the given
FirebaseApp . | |||||||||||
Returns a token that authorizes an Entity to perform
an action on behalf of the application identified by Instance ID.
| |||||||||||
Return the master token for the default Firebase project.
|
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
![]() |
Resets Instance ID and revokes all tokens.
Throws | |
---|---|
IOException |
Revokes access to a scope (action) for an entity previously
authorized by getToken()
.
Parameters | |
---|---|
authorizedEntity |
String :
Entity that must no longer have access. |
scope |
String :
Action that entity is no longer authorized to perform. |
Throws | |
---|---|
IOException |
if the request fails. |
Returns time when instance ID was created.
Returns | |
---|---|
long |
Time when instance ID was created (milliseconds since Epoch). |
Returns a stable identifier that uniquely identifies the app instance.
Returns | |
---|---|
String |
The identifier for the application instance. |
Returns an instance of this class.
Returns | |
---|---|
FirebaseInstanceId |
FirebaseInstanceId instance. |
Returns an instance for the given FirebaseApp
.
Parameters | |
---|---|
app |
FirebaseApp :
FirebaseApp instance. |
Returns | |
---|---|
FirebaseInstanceId |
FirebaseInstanceId instance. |
Returns a token that authorizes an Entity to perform an action on behalf of the application identified by Instance ID.
This is similar to an OAuth2 token except, it applies to the application instance instead of a user. For example, to get a token that can be used to send messages to an application via FirebaseMessaging, set to the sender ID, and set to"FCM"
.
This is a blocking function so do not call it on the main thread.
Returns | |
---|---|
String |
a token that can identify and authorize the instance of the application on the device. |
Throws | |
---|---|
IOException |
if the request fails. |
Return the master token for the default Firebase project.
Returns | |
---|---|
String |
the master token or null if the token is not yet available |