React-NativeとFirebaseを使用してアプリケーションを構築しています。firebaseデータベースにアクセスできない(読み取りルールをtrueにしているにもかかわらず)
他のアプリで動作していたコード(ファイヤーベースから引き出すためのコード)は今回は動作しませんでした。
Possible Unhandled Promise Rejection (id: 0):
Error: permission_denied at /userList: Client doesn't have permission to access the desired data.
私はルール「真」(誰にでもオープン)作成場合でも、私はまだ同じエラーを取得:1時間のデータ呼を、私は次のエラーを取得する - だから、私は簡単であるためにそれを修正しました。同じアプリのどこかに、他の読み書き機能があります。ここで
は私の現在のルールとデータベースの構造です:
import firebase from 'firebase';
export const NAMES_FETCH = 'names_fetch'
export const namesFetch =() => {
return (dispatch) => {
firebase.database().ref(`/userList`).once('value').then(function(snapshot) {
var names = snapshot.val();
console.log('FIREBASE PRINT', names)
});
};
};
私はすべてを試みた、と午前:ここ
{
"rules": {
"users": {
"$uid": {
".read": "$uid === auth.uid",
".write": "$uid === auth.uid"
}
},
"public": {
"$uid": {
".read": "auth != null",
".write": "auth != null"
}
},
"feedback": {
"$uid": {
".read": "auth != null",
".write": "auth != null"
}
},
"userList": {
"$uid": {
".read": "auth != null",
".write": "auth != null"
}
}
}
}
は私のアクション呼び出しを行うクリエイターであります私の知恵の終わりに。ありがとうございました!
非常に同じコードは、私が「ユーザー」の代わりに「ユーザーリスト」のへのREFを変更した場合 –