Reputation: 1180
I've some apps working with Firebase using database, but the problem is why l dont have permission to access the desired data to firebase database ?
{
"rules": {
"profile": {
"$uid": {
".read": "true",
".write": "$uid === auth.uid"
}
}
}
}
ionViewWillLoad(){
this.fire.authState.subscribe(data => {
if(data && data.email && data.uid){
this.toastCtrl.create({
message : ` welcome ${data.email}`,
duration:2000
}).present()
this.itemRef = this.db.object(`report/profile/${data.uid}`);
this.item = this.itemRef.valueChanges();
}
})
}
Upvotes: 0
Views: 67
Reputation: 317750
Because, as I see in your screenshot, you're trying to access /
. But you've only granted access to /profile/$uid
. If you don't grant access to it, it's not readable from mobile clients. Or perhaps you meant to use a more specific path in the emulator to test?
Upvotes: 1