I am trying to get access to my firebase data to run a little test. I have setup an app in the firebase console and set the access rules to:
// Allow read/write access to all users under any conditions
// Warning: **NEVER** use this rule set in production; it allows
// anyone to overwrite your entire database.
service cloud.firestore {
match /databases/{database}/documents {
match /{document=**} {
allow read, write: if true;
}
}
}
Nevertheless I am always getting the following error:
angular.js:14328 Error: permission_denied at /messages: Client doesn't have permission to access the desired data.
at this line of code:
var ref = firebase.database().ref().child('messages');
What I am I missing?
Those rules are for firestore and not firebase-realtime database.
In the console go to the database section and click on the dropdown then choose RealTime database:
For the realtime database change your rules to this:
and then perform the tests.