admin 管理员组

文章数量: 1086019

I'm trying to configure debug token for my debug build. As official rnfirebase docs seems not to be up to date, I am not able to figure out what I'm missing here.

After I enabled App Check from Firebase console, I generated debug token for android app and enforced request validation for Firestore so my previously installed apps failed loading the data. All fine.

Then I initialized app check for new debug build, expecting that requests going to firebase sdk's will have token properly set up.

When I run new debug build firebase error appears: 'FirebaseError: Missing or insufficient permissions'

Two approaches I tried:

A)

  1. Updated app.json config plugin with @react-native-firebase/app-check
  2. Updated App.tsx with:
import { getToken, initializeAppCheck, ReactNativeFirebaseAppCheckProvider  } from "@react-native-firebase/app-check";
import { getApp } from '@react-native-firebase/app';

useEffect(() => {
    const registerAppCheck = async () => {
      try {
        let rnfbProvider = new ReactNativeFirebaseAppCheckProvider();
        rnfbProvider.configure({
          android: {
            provider: 'debug',
            debugToken: 'MY ANDROID DEBUG TOKEN',
          }
        });
        await initializeAppCheck(getApp(), { provider: rnfbProvider, isTokenAutoRefreshEnabled: true });
        console.log('AppCheck initialized')
      } catch (error) {
        console.log('AppCheck initialization failed');
      }
    }
    registerAppCheck()
  }, [])
  1. AppCheck initialized was logged once I run the build.

B)

  1. Updated app.json config plugin with @react-native-firebase/app-check
  2. Updated eas.json like this:
 "build": {
    "development": {
      "developmentClient": true,
      "distribution": "internal",
      "android": {
        "buildType": "apk"
      },
      "env": {
        "FIREBASE_APP_CHECK_DEBUG_TOKEN": "MY ANDROID DEBUG TOKEN"
      }
    },
  ...

Am I missing something important here ?

本文标签:

Error[2]: Invalid argument supplied for foreach(), File: /www/wwwroot/roclinux.cn/tmp/view_template_quzhiwa_htm_read.htm, Line: 58
File: /www/wwwroot/roclinux.cn/tmp/route_read.php, Line: 205, include(/www/wwwroot/roclinux.cn/tmp/view_template_quzhiwa_htm_read.htm)
File: /www/wwwroot/roclinux.cn/tmp/index.inc.php, Line: 129, include(/www/wwwroot/roclinux.cn/tmp/route_read.php)
File: /www/wwwroot/roclinux.cn/index.php, Line: 29, include(/www/wwwroot/roclinux.cn/tmp/index.inc.php)