Back to Firebase Js Sdk

installations package

docs-devsite/installations.md

12.12.15.7 KB
Original Source

Project: /docs/reference/js/_project.yaml Book: /docs/reference/_book.yaml page_type: reference

{% comment %} DO NOT EDIT THIS FILE! This is generated by the JS SDK team, and any local changes will be overwritten. Changes should be made in the source code at https://github.com/firebase/firebase-js-sdk {% endcomment %}

installations package

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

Functions

FunctionDescription
<b>function(app, ...)</b>
getInstallations(app)Returns an instance of Installations associated with the given FirebaseApp instance.
<b>function(installations, ...)</b>
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 via IdChangeCallbackFn<!-- -->.

function(app, ...)

getInstallations(app) {:#getinstallations_cf608e1}

Returns an instance of Installations associated with the given FirebaseApp instance.

<b>Signature:</b>

typescript
export declare function getInstallations(app?: FirebaseApp): Installations;

Parameters

ParameterTypeDescription
appFirebaseAppThe FirebaseApp instance.

<b>Returns:</b>

Installations

function(installations, ...)

deleteInstallations(installations) {:#deleteinstallations_606c567}

Deletes the Firebase Installation and all associated data.

<b>Signature:</b>

typescript
export declare function deleteInstallations(installations: Installations): Promise<void>;

Parameters

ParameterTypeDescription
installationsInstallationsThe <code>Installations</code> instance.

<b>Returns:</b>

Promise<void>

getId(installations) {:#getid_606c567}

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

<b>Signature:</b>

typescript
export declare function getId(installations: Installations): Promise<string>;

Parameters

ParameterTypeDescription
installationsInstallationsThe <code>Installations</code> instance.

<b>Returns:</b>

Promise<string>

getToken(installations, forceRefresh) {:#gettoken_cf009a7}

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

<b>Signature:</b>

typescript
export declare function getToken(installations: Installations, forceRefresh?: boolean): Promise<string>;

Parameters

ParameterTypeDescription
installationsInstallationsThe <code>Installations</code> instance.
forceRefreshbooleanForce refresh regardless of token expiration.

<b>Returns:</b>

Promise<string>

onIdChange(installations, callback) {:#onidchange_b579e0e}

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

<b>Signature:</b>

typescript
export declare function onIdChange(installations: Installations, callback: IdChangeCallbackFn): IdChangeUnsubscribeFn;

Parameters

ParameterTypeDescription
installationsInstallationsThe <code>Installations</code> instance.
callbackIdChangeCallbackFnThe callback function that is invoked when FID changes.

<b>Returns:</b>

IdChangeUnsubscribeFn

A function that can be called to unsubscribe.

IdChangeCallbackFn

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

<b>Signature:</b>

typescript
export type IdChangeCallbackFn = (installationId: string) => void;

IdChangeUnsubscribeFn

Unsubscribe a callback function previously added via IdChangeCallbackFn<!-- -->.

<b>Signature:</b>

typescript
export type IdChangeUnsubscribeFn = () => void;