I am out of ideas right now why my app does not pass app check verifications. I am building a React-Native app with Firebase using react-native-firebase. It throws this error:
[firestore/permission-denied]
I have installed the app-check package for react native. I have added these lines to app/build.gradle:
implementation 'com.google.firebase:firebase-appcheck-safetynet'
implementation 'com.google.firebase:firebase-appcheck-debug'
I have enabled App Check in Firebase console and added the SHA-256 certificate fingerprint to it.
I have added this flag to firebase.json:
"automaticResourceManagement": true,
and finally, the initialization of the app check in index.js:
import { firebase } from '@react-native-firebase/app-check';
try {
firebase.appCheck().setTokenAutoRefreshEnabled(true);
firebase.appCheck().activate('ignored', true);
const appchecktoken = firebase.appCheck().getToken(true);
console.log("app check success, appchecktoken: " + JSON.stringify(appchecktoken));
} catch (e) {
console.log("Failed to initialize appCheck:", e);
}
When I print the appchecktoken
it seems empty:
{"_U":0,"_V":0,"_W":null,"_X":null}
What am I missing here? Please remember that I am using the react-native-firebase package and not the native packages.