Google is committed to advancing racial equity for Black communities. See how.

Manage Firebase installations

The Firebase installations service (FIS) provides a Firebase installation ID (FID) for each installed instance of a Firebase app. This unique identifier is used internally by Firebase services such as FCM or Remote Config without requiring developers to interact directly with the FIS API.

However, there are some cases where app developers might want to directly call the FIS API—most importantly, deleting an app instance and all related data and statistics for "data wipeout" purposes.

Delete a Firebase installation and associated data

Data associated with a Firebase installation is generally not personally identifying. Still, it can be helpful (and in some cases legally required) to give users an option to manage and delete this data. The deletion procedures described below result in a GDPR-compliant wipeout of all data recorded for a particular Firebase installation.

Firebase installation IDs are different for every installation of every application; different applications on the same device have different Firebase installation IDs. Firebase installation IDs identify app installations and data associated with those app installations, and allow the deletion of the data associated with individual app installations across all Firebase services.

When you deleta an installation ID, the associated data is removed from live and backup systems of all Firebase services within 180 days.

Unless you disable all FID-generating services in your app, FIS creates a new ID within a few days. Firebase considers the newly-created ID to be a new Firebase installation, and doesn't associate it with the previous ID or data in any way.

Delete an FID with a client API call

To delete FIDs generated by Firebase services, call the appropriate method from the Firebase installations SDK:

Swift

func delete(completion: @escaping (Error?) -> Void)

Objective-C

- (void)deleteWithCompletion:(nonnull void (^)(NSError *_Nullable))completion;

Android

Task.await(FirebaseInstallations.getInstance().delete());

JavaScript

firebase.installations.delete().then((void)

Delete an FID with a server API call

To delete an FID with a server API call, add the Firebase Admin SDK to your server, if you haven't already.

Once the SDK is added, delete FIDs through a call to the deletion function in your language of choice (note: though these methods reflect Instance ID naming, they actually delete the FID when called with any current Firebase SDK).

Node.js

// An FID sent from a client service SDK
const idToDelete = 'eyJhbGciOiJFUzI1N_iIs5';

admin.instanceId().deleteInstanceId(idToDelete);

Java

// An FID sent from a client service SDK
String idToDelete = "eyJhbGciOiJFUzI1N_iIs5";

FirebaseInstanceId.getInstance().deleteInstanceIdAsync(idToDelete).get();

Python

  from firebase_admin import instance_id

  # An FID sent from a client service SDK
  id_to_delete = 'eyJhbGciOiJFUzI1N_iIs5'

  instance_id.delete_instance_id(id_to_delete)

Go

client, err := app.InstanceId(ctx)
if err != nil {
  log.Fatalln("error initializing client", err)
}

iidToDelete := "eyJhbGciOiJFUzI1N_iIs5"
if err := client.DeleteInstanceId(ctx, iidToDelete); err != nil {
  log.Fatalln("error deleting FID", err)
}

When you delete an Firebase installation ID with a server API call, Firebase services delete the associated data, stop accepting new data for that ID over the course of 1-2 days, and then notify the client app that the ID was deleted. Until Firebase notifies the client app, some of the app's services might still target the ID—for example, an app instance might continue to receive FCM notifications for a few hours.

If you want to delete the current Firebase installation ID and immediately use Firebase services with a new, unrelated ID, use the client API to handle the deletion.

Firebase installations and Instance ID

For data wipeout as well as internal use, FIS is backward-compatible with the legacy identifier Firebase Instance ID. Deleting an IID is an alternative method of performing data wipeout with these Firebase SDKs:

  • iOS 6.14.0 and lower
  • Android SDKs earlier than February 27, 2020

If you want to perform data wipeout with more recent iOS and Android SDKs, updating your code to use FIS is recommended but not required.