I have created a realtime database and connected it to my app
I have used the secret key to access it. I have used the url and project bucket
When I set the rules
{
"rules": {
".read": "true",
".write": "true"
}
}
then I can write and read
when I change to
{
"rules": {
".read": "auth != null",
".write": "auth != null"
}
}
then I can only READ but NOT write!
If I change again to
{
"rules": {
".read": "auth != null",
".write": "true"
}
}
then I can read and write!
Is there anything else I should configure in my realtime database?
Should I remove the secret key? If yes then how do I authenticate users?
When I open the app after a day then at the screen open I receive FIrebaseError: permission denied. BUT even still when I create a new entry or try to read its ok! Why this is happening if the user has not tried to log in?
Should the user be authenticated within the blocks first before gain access to firebase? Or a user can sign in via a different screen and then is allowed to change data to another screen?
I apologize..
Its the native firebase component as you mentioned it. The extension is for authenticator.
Did someone used the native firebase component for data storing?
I have set these rules:
{
"rules": {
"messages": {
"$uid": {
// Allow only authenticated content owners access to their data
".read": "$uid === auth.uid",
".write": "$uid === auth.uid"
}
}
}
}
and used the below block
I have used it as well without the ''messages/'' part because I have set the bucket in the settings..
When I try to write data as above then I get no error message for some reason but no data is stored.
When I try to read then I get an error ''permission denied''
Maybe I am doing something wrong with the blocks code?
Where ever I read they say to authenticate before writing or sending, but how?
Authenticate once or every time before I send data and with which way/key to authenticate?
PS when I set rules of firebase to true then I can read and write
I have created the block to register but I cannot see any user being created in firebase.
When I paste the url from blocks to my browser with the API key then I can see my console and an empty directory /accounts:signUp
Also the articles says about saving the return values. Where can I find the return value?
You mention in the post to use a dictionary in order to correctly set the dataToWrite.
Could you tell me where I can find that dictionary? Is data to write the TAG?
However I used your code and managed to register user but cannot write data.
Data path I used my firebase URL is that correct?
Id Token can I use the one I got back from response after sign up or should I refresh?
Hi, excuse me who said the Firebase manager extension cannot use the rules, it is absolutely wrong.
If You check, I use in my sample the same rules that You want to use for your project
No need to accuse anyone. I just read in some posts that the experimental component for firebase cannot be used with authorization rules etc.. Also while trying to use the component I could not access the database with rules other than READ, WRITE TRUE.
Can you please quide me how to set the field "data to write" correctly with the dictionary as you mention in your post about the component you made?
Also "data path" should be my firebase URL?
regarding path data
you join global project ID + global Uid +"/" + some text
so my question is
if I dont want to write to a bucket "shopping list" then I leave this blank or just put my firebase url?
is the Uid something you created to keep track of your list? If not then theUid should be the localid we receive from firebase?
I just need to write a simple hello to database so I would know that it works!
PS
I have set up your shopping list example
I have registered user successfully
I try to add an item but lets me press the add item button only if I take a photo. When I take photo, enter the name and quantity I press add add item but I get warning "NOT FOUND"
Did I do something worng?
I initialised both storage and database and set the rules you provided
ps2
I have changed the block code and added my project id
I have created a bucket shoppinglist in the firebase, should I create one for firestore?