installations package

The Firebase Installations Web SDK. This SDK does not work in a Node.js environment.

Functions

FunctionDescription
function(app, ...)
getInstallations(app)Returns an instance ofInstallations associated with the givenFirebaseApp instance.
function(installations, ...)
deleteInstallations(installations)Deletes the Firebase Installation and all associated data.
getId(installations)Creates a Firebase Installation if there isn't one for the app and returns the Installation ID.
getToken(installations, forceRefresh)Returns a Firebase Installations auth token, identifying the current Firebase Installation.
onIdChange(installations, callback)Sets a new callback that will get called when Installation ID changes. Returns an unsubscribe function that will remove the callback when called.

Interfaces

InterfaceDescription
InstallationsPublic interface of the Firebase Installations SDK.

Type Aliases

Type AliasDescription
IdChangeCallbackFnAn user defined callback function that gets called when Installations ID changes.
IdChangeUnsubscribeFnUnsubscribe a callback function previously added viaIdChangeCallbackFn.

function(app, ...)

getInstallations(app)

Returns an instance ofInstallations associated with the givenFirebaseApp instance.

Signature:

exportdeclarefunctiongetInstallations(app?:FirebaseApp):Installations;

Parameters

ParameterTypeDescription
appFirebaseAppTheFirebaseApp instance.

Returns:

Installations

function(installations, ...)

deleteInstallations(installations)

Deletes the Firebase Installation and all associated data.

Signature:

exportdeclarefunctiondeleteInstallations(installations:Installations):Promise<void>;

Parameters

ParameterTypeDescription
installationsInstallationsTheInstallations instance.

Returns:

Promise<void>

getId(installations)

Creates a Firebase Installation if there isn't one for the app and returns the Installation ID.

Signature:

exportdeclarefunctiongetId(installations:Installations):Promise<string>;

Parameters

ParameterTypeDescription
installationsInstallationsTheInstallations instance.

Returns:

Promise<string>

getToken(installations, forceRefresh)

Returns a Firebase Installations auth token, identifying the current Firebase Installation.

Signature:

exportdeclarefunctiongetToken(installations:Installations,forceRefresh?:boolean):Promise<string>;

Parameters

ParameterTypeDescription
installationsInstallationsTheInstallations instance.
forceRefreshbooleanForce refresh regardless of token expiration.

Returns:

Promise<string>

onIdChange(installations, callback)

Sets a new callback that will get called when Installation ID changes. Returns an unsubscribe function that will remove the callback when called.

Signature:

exportdeclarefunctiononIdChange(installations:Installations,callback:IdChangeCallbackFn):IdChangeUnsubscribeFn;

Parameters

ParameterTypeDescription
installationsInstallationsTheInstallations instance.
callbackIdChangeCallbackFnThe callback function that is invoked when FID changes.

Returns:

IdChangeUnsubscribeFn

A function that can be called to unsubscribe.

IdChangeCallbackFn

An user defined callback function that gets called when Installations ID changes.

Signature:

exporttypeIdChangeCallbackFn=(installationId:string)=>void;

IdChangeUnsubscribeFn

Unsubscribe a callback function previously added viaIdChangeCallbackFn.

Signature:

exporttypeIdChangeUnsubscribeFn=()=>void;

Except as otherwise noted, the content of this page is licensed under theCreative Commons Attribution 4.0 License, and code samples are licensed under theApache 2.0 License. For details, see theGoogle Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.

Last updated 2024-11-14 UTC.