Skip to content

No permission error while using Firebase Database #9

Closed
@linuxing3

Description

@linuxing3

When I using the firestack.database() to get key object from firebase real time database, it shows error Client doesn't have permission to access Desired data.
When I changed the rules in firebase console to no auth for reading, it works fine.
Does the database object need extra token to access database?

Rules on firebase console

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

Testing code

export const db = async(key) => {
    let snap = await firestack.database.ref(key).once('value');
    let str = JSON.stringify(snap.val());
    if (snap) {
        Alert.alert(snap.key);
        return snap.val();
    };
};

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions