Hi, everyone! In advance, I really thank you for your time and patience.
I have created users in firebase from my register screen but now I want to save data (scores) from another screeen for each user. Despite the fact that I have read documentation, search for help in tutorials and dedicated time to solve it for myself, I will be happy if I can get some help from you, thunkers.
First you need to create an app variable to hold the userId in the login / registration screen.
Then in the other screen use this variable to generate the key for the firebase entry.
@muneer I am sorry for keeping asking basic questions. These are my blocks but for some reason the scores are overwritten. Do you know what am doing wrong?
Once again, thank you very much for your pricesless help
Yes, this is correct.
Under scores you are saving some values. Every time you call the Save block, you are overwriting existing values.
You have two options:
Use counters for the scores to avoid overwriting. Example score/1, score/2, score/3 so that every time you increase the number and you will have your scores saved under the number not directly under the score key.
Use lists. In the object under scores don’t save the score variable directly but save a list of scores and every time you update the list. When you save, the updated list will be saved.
Hello @muneer, Thank you for such a nice solution - I was also going through the same problem, But can’t get the block of call the database> Please help me with it!
It’s hard to help someone when they say they have “the same problem” without sharing what they’ve tried. Screenshots or a link to a project are really helpful.