Skip to content

Commit e0e9e3f

Browse files
committed
docs(app-check): attempt to clarify debug provider usage
this may not be clear yet, but should emphasize that you may have different providers for different scenarios (like, if __DEV__ flag configured, use debug provider)
1 parent 87156e7 commit e0e9e3f

1 file changed

Lines changed: 10 additions & 8 deletions

File tree

docs/app-check/usage/index.md

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -103,10 +103,12 @@ To configure the react-native-firebase custom provider, first obtain one, then c
103103
rnfbProvider = firebase.appCheck().newReactNativeFirebaseAppCheckProvider();
104104
rnfbProvider.configure({
105105
android: {
106-
provider: 'playIntegrity',
106+
provider: __DEV__ ? 'debug' : 'playIntegrity',
107+
debugToken: 'some token you have configured for your project firebase web console',
107108
},
108109
apple: {
109-
provider: 'appAttestWithDeviceCheckFallback',
110+
provider: __DEV__ ? 'debug' : 'appAttestWithDeviceCheckFallback',
111+
debugToken: 'some token you have configured for your project firebase web console',
110112
},
111113
web: {
112114
provider: 'reCaptchaV3',
@@ -157,20 +159,20 @@ There are a variety of other ways to obtain and configure debug tokens for AppCh
157159

158160
#### A) When testing on an actual android device (debug build)
159161

160-
1. Start your application on the android device.
161-
2. Use `$adb logcat | grep DebugAppCheckProvider` to grab your temporary secret from the android logs. The output should look lit this:
162+
1. Start your application on the android device.
163+
2. Use `$adb logcat | grep DebugAppCheckProvider` to grab your temporary secret from the android logs. The output should look lit this:
162164

163165
D DebugAppCheckProvider: Enter this debug secret into the allow list in
164166
the Firebase Console for your project: XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX
165167

166-
3. In the [Project Settings > App Check](https://console.firebase.google.com/project/_/settings/appcheck) section of the Firebase console, choose _Manage debug tokens_ from your app's overflow menu. Then, register the debug token you logged in the previous step.
168+
3. In the [Project Settings > App Check](https://console.firebase.google.com/project/_/settings/appcheck) section of the Firebase console, choose _Manage debug tokens_ from your app's overflow menu. Then, register the debug token you logged in the previous step.
167169

168170
#### B) Specifying a generated `FIREBASE_APP_CHECK_DEBUG_TOKEN` -- building for CI/CD (debug build)
169171

170172
When you want to test using an Android virtual device -or- when you prefer to (re)use a token of your choice -- e.g. when configuring a CI/CD pipeline -- use the following steps:
171173

172-
1. In the [Project Settings > App Check](https://console.firebase.google.com/project/_/settings/appcheck) section of the Firebase console, choose _Manage debug tokens_ from your app's overflow menu. Then, register a new debug token by clicking the _Add debug token_ button, then _Generate token_.
173-
2. Pass the token you created in the previous step by supplying a `FIREBASE_APP_CHECK_DEBUG_TOKEN` environment variable to the process that build your react-native android app. e.g.:
174+
1. In the [Project Settings > App Check](https://console.firebase.google.com/project/_/settings/appcheck) section of the Firebase console, choose _Manage debug tokens_ from your app's overflow menu. Then, register a new debug token by clicking the _Add debug token_ button, then _Generate token_.
175+
2. Pass the token you created in the previous step by supplying a `FIREBASE_APP_CHECK_DEBUG_TOKEN` environment variable to the process that build your react-native android app. e.g.:
174176

175177
FIREBASE_APP_CHECK_DEBUG_TOKEN="XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX" react-native run-android
176178

@@ -201,6 +203,6 @@ When using expo-dev-client, the process is a little different, especially on an
201203
}
202204
```
203205

204-
3. Rebuild your development client:
206+
3. Rebuild your development client:
205207

206208
eas build --profile development --platform android

0 commit comments

Comments
 (0)