Firebase: Database reference 'on' method not running callback (javascript)
See Firebase Rules, You dont have permission to Access Firebase Database Collection.
Go to Firebase Console, Database, Rules to update:
{
"support{
".read": true, // allow read
".write": false
}
}
You don't have permission to read the data. To see this, you can attach a completion listener and log the error it gives you:
var ref=firebase.database().ref("support/"+id);
console.log("In getData, looking for ",ref);
// get support data from firebase
ref.on('value',function (snapshot) {
console.log("In Value");
console.log(snapshot);
}, function(error) {
console.error(error);
});
console.log("end getData, looking for ",ref);
Doing so shows:
Error: permission_denied at /support/abc: Client doesn't have permission to access the desired data.