public abstract class FirebaseAppCheck extends Object
implements InternalAppCheckTokenProvider

Nested Class Summary

interface FirebaseAppCheck.AppCheckListener  

Public Constructor Summary

Public Method Summary

abstract void
addAppCheckListener(FirebaseAppCheck.AppCheckListener listener)
Registers an FirebaseAppCheck.AppCheckListener to changes in the token state.
abstract Task<AppCheckToken>
getAppCheckToken(boolean forceRefresh)
Requests a Firebase App Check token.
static FirebaseAppCheck
getInstance()
Gets the default instance of FirebaseAppCheck.
static FirebaseAppCheck
getInstance(FirebaseApp firebaseApp)
Gets the instance of FirebaseAppCheck associated with the given FirebaseApp instance.
abstract void
installAppCheckProviderFactory(AppCheckProviderFactory factory)
Installs the given AppCheckProviderFactory, overwriting any that were previously associated with this FirebaseAppCheck instance.
abstract void
installAppCheckProviderFactory(AppCheckProviderFactory factory, boolean isTokenAutoRefreshEnabled)
Installs the given AppCheckProviderFactory, overwriting any that were previously associated with this FirebaseAppCheck instance.
abstract void
removeAppCheckListener(FirebaseAppCheck.AppCheckListener listener)
Unregisters an FirebaseAppCheck.AppCheckListener to changes in the token state.
abstract void
setTokenAutoRefreshEnabled(boolean isTokenAutoRefreshEnabled)
Sets the isTokenAutoRefreshEnabled flag.

Inherited Method Summary

Public Constructors

public FirebaseAppCheck ()

Public Methods

public abstract void addAppCheckListener (FirebaseAppCheck.AppCheckListener listener)

Registers an FirebaseAppCheck.AppCheckListener to changes in the token state. This method should be used ONLY if you need to authorize requests to a non-Firebase backend. Requests to Firebase backends are authorized automatically if configured.

Parameters
listener

public abstract Task<AppCheckToken> getAppCheckToken (boolean forceRefresh)

Requests a Firebase App Check token. This method should be used ONLY if you need to authorize requests to a non-Firebase backend. Requests to Firebase backends are authorized automatically if configured.

Parameters
forceRefresh

public static FirebaseAppCheck getInstance ()

Gets the default instance of FirebaseAppCheck.

public static FirebaseAppCheck getInstance (FirebaseApp firebaseApp)

Gets the instance of FirebaseAppCheck associated with the given FirebaseApp instance.

Parameters
firebaseApp

public abstract void installAppCheckProviderFactory (AppCheckProviderFactory factory)

Installs the given AppCheckProviderFactory, overwriting any that were previously associated with this FirebaseAppCheck instance. Any AppCheckTokenListeners attached to this FirebaseAppCheck instance will be transferred from existing factories to the newly installed one.

Automatic token refreshing will only occur if the global isDataCollectionDefaultEnabled flag is set to true. To allow automatic token refreshing for Firebase App Check without changing the isDataCollectionDefaultEnabled flag for other Firebase SDKs, use installAppCheckProviderFactory(AppCheckProviderFactory, boolean) instead or call setTokenAutoRefreshEnabled(boolean) after installing the factory.

Parameters
factory

public abstract void installAppCheckProviderFactory (AppCheckProviderFactory factory, boolean isTokenAutoRefreshEnabled)

Installs the given AppCheckProviderFactory, overwriting any that were previously associated with this FirebaseAppCheck instance. Any AppCheckTokenListeners attached to this FirebaseAppCheck instance will be transferred from existing factories to the newly installed one.

Automatic token refreshing will only occur if the isTokenAutoRefreshEnabled field is set to true. To use the global isDataCollectionDefaultEnabled flag for determining automatic token refreshing, call installAppCheckProviderFactory(AppCheckProviderFactory) instead.

Parameters
factory
isTokenAutoRefreshEnabled

public abstract void removeAppCheckListener (FirebaseAppCheck.AppCheckListener listener)

Unregisters an FirebaseAppCheck.AppCheckListener to changes in the token state.

Parameters
listener

public abstract void setTokenAutoRefreshEnabled (boolean isTokenAutoRefreshEnabled)

Sets the isTokenAutoRefreshEnabled flag.

Parameters
isTokenAutoRefreshEnabled