chrome.instanceID.deleteID(
callback?: function,
)
Resets the app instance identifier and revokes all tokens associated with it.
function optional
The callback
parameter looks like: () => void
Promise<void>
Promises are supported in Manifest V3 and later, but callbacks are provided for backward compatibility. You cannot use both on the same function call. The promise resolves with the same type that is passed to the callback.
chrome.instanceID.deleteToken(
deleteTokenParams: object,
callback?: function,
)
Revokes a granted token.
object
Parameters for deleteToken.
string
The authorized entity that is used to obtain the token.
string
The scope that is used to obtain the token.
function optional
The callback
parameter looks like: () => void
Promise<void>
Promises are supported in Manifest V3 and later, but callbacks are provided for backward compatibility. You cannot use both on the same function call. The promise resolves with the same type that is passed to the callback.
chrome.instanceID.getCreationTime(
callback?: function,
)
Retrieves the time when the InstanceID has been generated. The creation time will be returned by the callback
.
function optional
The callback
parameter looks like: (creationTime: number) => void
number
The time when the Instance ID has been generated, represented in milliseconds since the epoch.
Promise<number>
Promises are supported in Manifest V3 and later, but callbacks are provided for backward compatibility. You cannot use both on the same function call. The promise resolves with the same type that is passed to the callback.
chrome.instanceID.getID(
callback?: function,
)
Retrieves an identifier for the app instance. The instance ID will be returned by the callback
. The same ID will be returned as long as the application identity has not been revoked or expired.
function optional
The callback
parameter looks like: (instanceID: string) => void
string
An Instance ID assigned to the app instance.
Promise<string>
Promises are supported in Manifest V3 and later, but callbacks are provided for backward compatibility. You cannot use both on the same function call. The promise resolves with the same type that is passed to the callback.
chrome.instanceID.getToken(
getTokenParams: object,
callback?: function,
)
Return a token that allows the authorized entity to access the service defined by scope.
object
Parameters for getToken.
string
Identifies the entity that is authorized to access resources associated with this Instance ID. It can be a project ID from Google developer console.
object optional
options are deprecated and will be ignored.
Allows including a small number of string key/value pairs that will be associated with the token and may be used in processing the request.
string
Identifies authorized actions that the authorized entity can take. E.g. for sending GCM messages, GCM
scope should be used.
function optional
The callback
parameter looks like: (token: string) => void
string
A token assigned by the requested service.
Promise<string>
Promises are supported in Manifest V3 and later, but callbacks are provided for backward compatibility. You cannot use both on the same function call. The promise resolves with the same type that is passed to the callback.
chrome.instanceID.onTokenRefresh.addListener(
callback: function,
)
Fired when all the granted tokens need to be refreshed.
function
The callback
parameter looks like: () => void
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2024-05-24 UTC.