FirebaseAppCheck Framework Reference Stay organized with collections Save and categorize content based on your preferences.
FIRAppCheck
@interfaceFIRAppCheck:NSObjectA class used to manage app check tokens for a given Firebase app.
Unavailable
Undocumented
Declaration
Objective-C
-(instancetype)initNS_UNAVAILABLE;Returns a default instance of
AppCheck.Declaration
Objective-C
+(nonnullinstancetype)appCheck;Return Value
An instance of
AppCheckforFirebaseApp.defaultApp().@throw Throws an exception if the default app is not configured yet or requiredFirebaseAppoptions are missing.Returns an instance of
AppCheckfor an application.Declaration
Objective-C
+(nullableinstancetype)appCheckWithApp:(nonnullFIRApp*)firebaseApp;Parameters
firebaseAppA configured
FirebaseAppinstance if exists.Return Value
An instance of
AppCheckcorresponding to the passed application.@throw Throws an exception if requiredFirebaseAppoptions are missing.Sets the
AppCheckProviderFactoryto use to generateAppCheckDebugProviderobjects.An instance of
DeviceCheckProviderFactoryis used by default, but you canalso use a customAppCheckProviderFactoryimplementation or aninstance ofAppCheckDebugProviderFactoryto test your app on a simulatoron a local machine or a build server.NOTE: Make sure to call this method before
FirebaseApp.configure(). Ifthis method is called after configuring Firebase, the changes will not takeeffect.Declaration
Objective-C
+(void)setAppCheckProviderFactory:(nullableid<FIRAppCheckProviderFactory>)factory;If this flag is disabled then Firebase app check will not periodically auto-refresh the appcheck token. The default value of the flag is equal to
FirebaseApp.dataCollectionDefaultEnabled. To disable the flag by default setFirebaseAppCheckTokenAutoRefreshEnabledflag in the app Info.plist toNO. Once the flag isset explicitly, the value will be persisted and used as a default value on next app launches.Declaration
Objective-C
@property(nonatomic)BOOLisTokenAutoRefreshEnabled;Requests Firebase app check token. This method shouldonly be used if you need to authorizerequests to a non-Firebase backend. Requests to Firebase backend are authorized automatically ifconfigured.
If your non-Firebase backend exposes sensitive or expensive endpoints that have low trafficvolume, consider protecting it withReplayProtection.In this case, use the
limitedUseToken(completion:)instead to obtain a limited-use token.Declaration
Objective-C
-(void)tokenForcingRefresh:(BOOL)forcingRefreshcompletion:(nonnullvoid(^)(FIRAppCheckToken*_Nullable,NSError*_Nullable))handler;Parameters
forcingRefreshIf
YES, a new Firebase app check token is requested and the tokencache is ignored. IfNO, the cached token is used if it exists and has not expired yet. Inmost cases,NOshould be used.YESshould only be used if the server explicitly returns anerror, indicating a revoked token.handlerThe completion handler. Includes the app check token if the request succeeds,or an error if the request fails.
Requests a limited-use Firebase App Check token. This method should be used only if you need toauthorize requests to a non-Firebase backend.
Returns limited-use tokens that are intended for use with your non-Firebase backend endpointsthat are protected withReplayProtection.This method does not affect the token generation behavior of the
tokenForcingRefresh()method.Declaration
Objective-C
-(void)limitedUseTokenWithCompletion:(nonnullvoid(^)(FIRAppCheckToken*_Nullable,NSError*_Nullable))handler;
Except as otherwise noted, the content of this page is licensed under theCreative Commons Attribution 4.0 License, and code samples are licensed under theApache 2.0 License. For details, see theGoogle Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2025-03-11 UTC.