React-native-firebase and firebase configuration problem with firestore access

Viewed 59

So I have my react-native project setup for firebase. I was mostly using analytics and crashlytics, and the firebase configuration files for both the ios and android deployments are correctly configured (the plist and json files), as I am able to use those services.

Now I want to also use the firestore. I was under the impression that the same configuration files with the firebase access info would be enough. But it doesn't seem to be the case. And I don't understand why.

My firebase access rule is simple enough:

rules_version = '2';
service cloud.firestore {
  match /databases/{database}/documents {
    match /receipts/{receipt} {
        allow read, write: if request.auth != null;
    }
  }
}

The error I'm getting is:

[Error: [firestore/permission-denied] The caller does not have permission to execute the specified operation.]

which goes away if I remove the if condition in the rule.

So I don't think the problem is there. I was wondering if for some reason firestore requires the web type configuration in my app, in the firebase.js file. But at this point I am doing trial and error development here...

Any insight would be much appreciated.

0 Answers
Related