admin管理员组文章数量:1394585
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)
- Updated app.json config plugin with @react-native-firebase/app-check
- 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()
}, [])
- AppCheck initialized was logged once I run the build.
B)
- Updated app.json config plugin with @react-native-firebase/app-check
- 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 ?
本文标签:
版权声明:本文标题:javascript - React Native (Expo Managed Flow): Proper way to configure Firebase App Check debug token - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1744097174a2590492.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论