Hello, I am making an app where certain features are unlocked with points. The fastest way to earn points is by watching a rewarded video ad, so I am using AdMob Rewarded Ads. I have placed the ads in my app, but I don’t know how to add points after the rewarded video ad is watched.
points are stored locally but after sign out and sign in again points will gone so i want to connect these point to firebase how i do this?
Hello @waqasbaloch88210ecsp
Have you set up Firebase sign-in?
Firebase has its own identification system. Therefore, each user has a distinct ID, on Firebase. Once a user signs up through Firebase, an ID is generated (which is received upon logging in) and this ID must also be saved in a stored variable for future use.
You can set in the beginning 0 points for each user and change it when they watch a Reward Ad using the stored variable userid variable.
I already set up Firebase authentication in the app, and points are added locally, but not in Firebase. If the user signs out, the points will be reset to 0. I need the points to remain the same when users sign back in.
Hi @waqasbaloch88210ecsp
Thank you for sharing more information
Have you tried to use the cloud variable block as it is in the screenshot?
I used it, but that’s the problem. I don’t know how to use these blocks properly. I’ve been trying to do this for many days, but I’m not understanding it correctly.
Hi @waqasbaloch88210ecsp
hHere it should change to cloud variable:
And also add the symbol “/” on the text “Users/” and “/Points”
It’s still not working in the app. Sir, maybe you’re not understanding my question. It’s like a score in a game, but not an actual game. I just want to add scores to Firebase and have them show up in the app. It works locally, but not with Firebase. When I test with Thunkable Live, I earn a score, but the scores disappear when I sign out and sign in again.
how much score user earning if it also show in firebase thats great with user email i am confused
I’ve tried many times, and with these blocks, the points are being added to Firebase. However, the main problem is that when I sign out and sign in again, the score resets to 0 in both Firebase and the app. Please tell me how to ensure that the points are added to Firebase and, after signing out and back in, the points are retrieved from Firebase, along with the email associated with the user who scored them.
Hello @waqasbaloch88210ecsp
Just to be sure that I understand, every user will have each one score.
To do that you will need to include user id when you set the variable. The variable is a list of user ids and each user id has a field “points”.
Here are the blocks you will need to save the points:
Here are the blocks to present the points:
No other blocks are needed.
This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.