Gets the InstanceId service for the default app or a given app.This API is deprecated. Developers are advised to use the getInstallations() API to delete their instance IDs and Firebase installation IDs.getInstanceId() can be called with no arguments to access the default app's InstanceId service or as getInstanceId(app) to access the InstanceId service associated with a specific app.
Gets the InstanceId service for the default app or a given app.
This API is deprecated. Developers are advised to use the getInstallations() API to delete their instance IDs and Firebase installation IDs.
getInstanceId() can be called with no arguments to access the default app's InstanceId service or as getInstanceId(app) to access the InstanceId service associated with a specific app.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2024-05-21 UTC."],[],[],null,["# firebase-admin.instance-id package\n\nFirebase Instance ID service.\n\nFunctions\n---------\n\n| Function | Description |\n|-----------------------------------------------------------------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| [getInstanceId(app)](./firebase-admin.instance-id.md#getinstanceid_8a40afc) | Gets the [InstanceId](./firebase-admin.instance-id.instanceid.md#instanceid_class) service for the default app or a given app.This API is deprecated. Developers are advised to use the [getInstallations()](./firebase-admin.installations.md#getinstallations_8a40afc) API to delete their instance IDs and Firebase installation IDs.`getInstanceId()` can be called with no arguments to access the default app's `InstanceId` service or as `getInstanceId(app)` to access the `InstanceId` service associated with a specific app. |\n\nClasses\n-------\n\n| Class | Description |\n|------------------------------------------------------------------------------------------------------------------------|--------------------------------------------------------------------------------------------------------------------|\n| [FirebaseInstanceIdError](./firebase-admin.instance-id.firebaseinstanceiderror.md#firebaseinstanceiderror_class) | Firebase instance ID error code structure. This extends FirebaseError. |\n| [InstanceId](./firebase-admin.instance-id.instanceid.md#instanceid_class) | The `InstanceId` service enables deleting the Firebase instance IDs associated with Firebase client app instances. |\n| [InstanceIdClientErrorCode](./firebase-admin.instance-id.instanceidclienterrorcode.md#instanceidclienterrorcode_class) | |\n\ngetInstanceId(app)\n------------------\n\n\u003e | **Warning:** This API is now obsolete.\n\u003e\n\u003e Use [getInstallations()](./firebase-admin.installations.md#getinstallations_8a40afc) instead.\n\nGets the [InstanceId](./firebase-admin.instance-id.instanceid.md#instanceid_class) service for the default app or a given app.\n\nThis API is deprecated. Developers are advised to use the [getInstallations()](./firebase-admin.installations.md#getinstallations_8a40afc) API to delete their instance IDs and Firebase installation IDs.\n\n`getInstanceId()` can be called with no arguments to access the default app's `InstanceId` service or as `getInstanceId(app)` to access the `InstanceId` service associated with a specific app.\n\n**Signature:** \n\n export declare function getInstanceId(app?: App): InstanceId;\n\n### Parameters\n\n| Parameter | Type | Description |\n|-----------|------|------------------------------------------------------------------------------------------------------------------------|\n| app | App | Optional app whose `InstanceId` service to return. If not provided, the default `InstanceId` service will be returned. |\n\n**Returns:**\n\n[InstanceId](./firebase-admin.instance-id.instanceid.md#instanceid_class)\n\nThe default `InstanceId` service if no app is provided or the `InstanceId` service associated with the provided app.\n\n### Example 1\n\n // Get the Instance ID service for the default app\n const defaultInstanceId = getInstanceId();\n\n### Example 2\n\n // Get the Instance ID service for a given app\n const otherInstanceId = getInstanceId(otherApp);\n\nThis API is deprecated. Developers are advised to use the `admin.installations()` API to delete their instance IDs and Firebase installation IDs."]]