and when he clicks on a button he gets a point.
I’m stuck here.
the same concept as app earning
as you can see from my beginner’s level, I thought I’d have this
so I can specify the current user but I don’t know how to add the value of 1 + its old value to it.
if I use the got value block I can add the value 1 + the old one but I can’t specify the user
so how can i select a specific user in firebase with subdirectory and add a new value + keep the old value
Okay,
for example there are 2 users each has a “test” folder.
user 1
mIfcvvI912141yfXZJQSVMevl2
test: “15”
user 2
mIfcvvI912141yfXZJQSVMevl2
test: “18”
when the user clicks on a button a value of 1 will be added to the test sub-folder
but my problem is during tests when both users click on the button only one test tag is created and takes the value 1,
I want that each time a user Click the value 1 will be added in the test subfolder, according to my little experience with kodular I have to select the current user automatically and give him the value but I don’t know how to do that, if I use the “current user block” I can’t add the value 1 to the old value and if I use the “got valut block” I can’t select the current user
Hi
I know I use the term earning app just to be clear, my app is a project that must store a value locally and on the web for each user who uses it.
“Like points of loyalty”
@pepocero
no I think my answer was not very clear because I use a google translation so I’ll try to explain it well.
the goal of my project is
if 10 users register each will have a user ID in farebase
then supposing that 4 users have clicked on the button to get 1 point each of the 4 will have a point the others will not.
I’m far away I don’t manage this and normally I don’t know who clicked or didn’t click all that I can see in the firebase that there are 4 users who have 1 point each.
with your method it won’t work because I need to have the use ID of that user and give them the value 1 but it’s not me who decides who should take a point it’s the user.
I’m stuck here when I do my tests with user IDs a new folder is created in the firebase as if it was a new user that takes the value 1 and when I click on the button of different phones it’s always this folder that takes the value and I can’t send the point to the user who clicked on it.
Hi friends
I spent all afternoon thinking of a logical solution and after several tests I found a solution I will share it with you. Maybe someone will have the same problem as me.
That’s how it works.
when the user registers his user Id is registered in Tiny DB and firebase.
when the user click on the button he calls firebase and to specify the tag from where the information must come I use the value stored in Tiny DB which is the user ID so I can specify the exact destination of the value.
so each user will have his own value in the exact folder