In Firebase, whenever I try to write to Firestore I’m getting permission errors in flutter. So I wanted to ask what signatures are you supposed to put in the settings? I’m currently using the services Firestore, Auth, and AppCheck.
I have 6 signatures in my settings:
- SHA-1, SHA-256: debug.keystore
- SHA-1, SHA-256: upload-keystore (is this needed?)
- SHA-1, SHA-256: App signing key certificate from google console
The reason why I think it has something to do with the signatures is because I’m able to write to Firestore when I’m using AndroidProvider.debug
in AppCheck. But when I make my release version using AndroidProvider.playIntegrity
Firestore denies me.
Error:
E/flutter (25396): [ERROR:flutter/runtime/dart_vm_initializer.cc(41)] Unhandled Exception: [cloud_firestore/permission-denied] The caller does not have permission to execute the specified operation.
Firestore rules:
rules_version = '2';
service cloud.firestore {
match /databases/{database}/documents {
match /{document=**} {
allow read, write: if isDev();
}
function isAuth() {
return request.auth != null;
}
function isDev() {
let datalist = ['[email protected]'];
return isAuth() && request.auth.token.email in datalist;
}
}
}
I’m using IntelliJ.
2
Answers
Okay long story short, I found out the phone I was testing API 28 on had been previously rooted. The original ROM had eventually been reinstalled but I guess it still qualifies as being rooted according to AppCheck.
You should use the SHA-256 certificate fingerprint that you can find in App integrity > App signing key certificate on the Google Play Console.
I stumbled upon the same issue today, and this is my current working setup. Hope this helps!