You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
(iOS) App Check requires you set the minimum iOS Deployment version in ios/Podfile to 11.0 or greater.
21
+
22
+
:::
23
+
24
+
### What does it do
25
+
26
+
App Check works alongside other Firebase services to help protect your backend resources from abuse, such as billing fraud or phishing. With App Check, devices running your app will use an app or device attestation provider that attests to one or both of the following:
27
+
28
+
Requests originate from your authentic app
29
+
Requests originate from an authentic, untampered device
30
+
This attestation is attached to every request your app makes to your Firebase backend resources.
This App Check module has built-in support for using the following services as attestation providers:
35
+
36
+
DeviceCheck on iOS
37
+
SafetyNet on Android
38
+
App Check currently works with the following Firebase products:
39
+
40
+
Realtime Database
41
+
Cloud Storage
42
+
Cloud Functions (callable functions)
43
+
The [official Firebase App Check documentation](https://firebase.google.com/docs/app-check) has more information, including about the iOS AppAttest provider, and testing/ CI integration, it is worth a read.
AppCheck.setProviderFactory() // call before the fb app is initialized
54
+
firebase.initializeApp().then((app) => {
55
+
firebase().appCheck().activate(true)
56
+
})
57
+
```
58
+
59
+
The only configuration possible is the token auto refresh. When you call activate, the provider stays the same but the token auto refresh setting will be changed based on the argument provided.
60
+
61
+
You must call activate prior to calling any firebase back-end services for App Check to function.
// finally call done when you're ready passing in a token along with the expirationDate
84
+
done({
85
+
token: someToken,
86
+
expirationDate: someDate,
87
+
})
88
+
}
89
+
}
90
+
91
+
AppCheck.setProviderFactory(newAppCheckProviderFactoryImpl()) // call before the fb app is initialized
92
+
firebase.initializeApp().then((app) => {
93
+
firebase().appCheck().activate(true)
94
+
})
95
+
```
96
+
97
+
### Automatic Data Collection
98
+
99
+
App Check has an "tokenAutoRefreshEnabled" setting. This may cause App Check to attempt a remote App Check token fetch prior to user consent. In certain scenarios, like those that exist in GDPR-compliant apps running for the first time, this may be unwanted.
100
+
101
+
If unset, the "tokenAutoRefreshEnabled" setting will defer to the app's "automatic data collection" setting, which may be set in the Info.plist or AndroidManifest.xml
102
+
103
+
### Using App Check tokens for non-firebase services
104
+
105
+
The [official documentation](https://firebase.google.com/docs/app-check/web/custom-resource) shows how to use getToken to access the current App Check token and then verify it in external services.
0 commit comments