FirebaseInstallations

public class FirebaseInstallations implements FirebaseInstallationsApi


Entry point for Firebase installations.

The Firebase installations service:

  • provides a unique identifier for a Firebase installation
  • provides an auth token for a Firebase installation
  • provides a API to perform GDPR-compliant deletion of a Firebase installation.

Summary

Public methods

@NonNull Task<Void>

Call to delete this Firebase app installation from the Firebase backend.

@NonNull Task<String>

Returns a globally unique identifier of this Firebase app installation.

static @NonNull FirebaseInstallations

Returns the FirebaseInstallations initialized with the default FirebaseApp.

static @NonNull FirebaseInstallations

Returns the FirebaseInstallations initialized with a custom FirebaseApp.

@NonNull Task<InstallationTokenResult>
getToken(boolean forceRefresh)

Returns a valid authentication token for the Firebase installation.

Public methods

delete

public @NonNull Task<Voiddelete()

Call to delete this Firebase app installation from the Firebase backend. This call may cause Firebase Cloud Messaging, Firebase Remote Config, Firebase A/B Testing, or Firebase In-App Messaging to not function properly.

getId

public @NonNull Task<StringgetId()

Returns a globally unique identifier of this Firebase app installation. This is a url-safe base64 string of a 128-bit integer.

getInstance

public static @NonNull FirebaseInstallations getInstance()

Returns the FirebaseInstallations initialized with the default FirebaseApp.

getInstance

public static @NonNull FirebaseInstallations getInstance(@NonNull FirebaseApp app)

Returns the FirebaseInstallations initialized with a custom FirebaseApp.

Parameters
@NonNull FirebaseApp app

a custom FirebaseApp

getToken

public @NonNull Task<InstallationTokenResultgetToken(boolean forceRefresh)

Returns a valid authentication token for the Firebase installation. Generates a new token if one doesn't exist, is expired, or is about to expire.

Should only be called if the Firebase installation is registered.

Parameters
boolean forceRefresh

Options to get an auth token either by force refreshing or not.