Firebase Permission denied Error

前端 未结 2 1955
半阙折子戏
半阙折子戏 2020-12-03 10:02

I am Very beginner to firebase and trying to get value from my database.

but it showing me same error every time.

    W/SyncTree: Listen at /child fa         


        
相关标签:
2条回答
  • 2020-12-03 10:28

    Listen at /child failed: FirebaseError: Permission denied

    It means that the node "child" does not have access permission.

    For a more secure approach, define the rule as follows:

    {
    
     "rules": { 
    
    "child": {
    
        ".read": "auth != null && auth.uid !=null" ,
    
        ".write": "auth != null && auth.uid !=null"  
       }
    
    }
    
    0 讨论(0)
  • 2020-12-03 10:31

    It's because you are not authorized to the Database, check the Rules Tab in the Realtime database

    If it's

    {
      "rules": {
        ".read": "auth != null",
        ".write":"auth != null"
      }
    }
    

    This means only authorized user's can write and read the Data.

    Changing to

    {
      "rules": {
        ".read": true,
        ".write":true
      }
    }
    

    Allows anyone to write the Database

    When going for Production be sure to use the first one

    0 讨论(0)
提交回复
热议问题