Skip to content Skip to sidebar Skip to footer

Firebase .on('value') Not Working

Im following this video right here. And here's my codes. index.html Fire Test

Solution 1:

Actually firebase's database has it's authentication and I found out that the rules on my database is not set properly (to public).

I changed this :

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

to

{"rules":{".read":true,".write":true}}

"auth != null" to true

Note

Setting the rules this way is a bad idea. We don't want anyone to access the root node. Though in this answer, this is just to test out the firebase connection.

Solution 2:

If you're trying to just get a returned object containing the current values stored at that location in your firebase db, change .on to .once.

Using .on indicates that you want something to dynamically happen every time the argued event occurs, but .once indicates that you just was the current data at that location.

Post a Comment for "Firebase .on('value') Not Working"