Useful or not, from you.
react-native-firebase Get Error : Firestore: The caller does not have permission to execute the specified operation. (firestore/permission-denied). But I have already signed in

<!-- ADD THE CONTENTS OF THE FILES IN THE PROVIDED CODE BLOCKS BELOW --> I have this problem and try to fix with all solutions I had found,but still not works. My rules in firebase cloud firestore is :

service cloud.firestore {
  match /databases/{database}/documents {
    match /{document=**} {
      allow read, write : if auth != null ;
    }
  }
}

And I had already enable Sign-in Method Anonymously.

Android

android/build.gradle:

        classpath 'com.android.tools.build:gradle:3.1.3'
        classpath 'com.google.gms:google-services:4.0.1'

android/app/build.gradle:

    compile project(':react-native-firebase')
    compile project(':react-native-fbsdk')
    implementation project(':react-native-firebase')
    implementation fileTree(dir: "libs", include: ["*.jar"])
    implementation "com.android.support:appcompat-v7:${rootProject.ext.supportLibVersion}"
    implementation "com.facebook.react:react-native:+"  // From node_modules

    implementation 'com.google.firebase:firebase-core:16.0.4'
    implementation 'com.google.firebase:firebase-auth:16.0.4'
    implementation 'com.google.firebase:firebase-firestore:17.1.0'

Testing.js:

firebase.auth().signInAnonymously().then(()=>{
        firebase.app().firestore().collection('Hello').doc('hello').set({
          id:'fadsa'
        }).catch((err)=>{
          alert(err);
        })
      })

Environment

<!-- change [ ] to [x] to select an option(s) -->

  • Platform that you're experiencing the issue on:
    • [ ] iOS
    • [x] Android
  • Operating System:
    • [x] Windows, version: N/A
  • Firebase module(s) you're using that has the issue:
    • [x] Authentication

    • [x] Cloud Firestore

<!-- Thanks for reading this far down ❤️ --> <!-- High quality, detailed issues are much easier and quicker to triage for maintainers -->

<!-- For bonus points, if you put a 🔥 (:fire:) emojii at the start of the issue title we'll know --> <!-- that you took the time to fill this out correctly, or, at least read this far -->


Think react-native-firebase is great? Please consider supporting the project with any of the below:

That's a useful answer
Without any help

@kyunkakata are you sure it is secure? ie. is auth not null when user is not logged in?