1
votes

I can't get permission to database.

In xcode console I am getting this message:

[Firebase/Database][I-RDB038012] Listener at /skelbimai failed: permission_denied

So I went to firebase database, then Rules and changed like this:

service cloud.firestore {
  match /databases/{database}/documents {
    match /{document=**} {
      allow read, write;
    }
  }
}

And still I cant read write from database. Where I missed something?

2

2 Answers

3
votes

The rules you changed are the rules for Cloud Firestore, while the error message is coming from the Firebase Realtime Database.

You'll need to switch your console from the Realtime Database to Firestore. To do so:

  1. Go to the Firebase database console

  2. Select Realtime Database

From here on the console will stick to showing the realtime database, unless you switch again.

If you already have the console open on one database, you can switch to the other by clicking on the dropdown next to Database and selecting the database you want to manage:

enter image description here

To grant full access to anyone, use these rules:

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

Please only use this for early development stages, as having your entire database publicly read-and-writeable makes it very easy to abuse.

0
votes

Try Following

Goto Database -> Rules then

copy and paste it

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