Help to set clock

Hello All,
In my app, I Created a button, When User clicks on it, Reward video ad show and User get 20 coins as a reward. Now I want to set it like users are not allowed to click again before 10 Minutes from last click.
Is it possible?
Pls help me with blocks or any other extension

1 Like

Yes it is Possible.

When a User Clicks on a Button Store the Date and Time of Click in Firebase in MM/dd/yyyy HH:mm:ss format.
Then Call Firebase to Get Tag with Date and Time Value.

And when Firebase Got Value do -

It will work but you can wait for others to answer, they can provide you a shorter or a much efficient method.


Thank you @ADDYLIN for Responce.

Can you use tinyDB. When compare get tinyDB data(saved time) greater than current time, call show ads and save current time to tinyDB.

Just use these blocks and you are done.

Hope it will help you. :slight_smile:


Well, you can work efficiently by using Tiny DB and comparing the present system time. :wink:

Earlier i also used TinyDB but in several Community Posts i read that its Better and Safe to Store Values in Firebase.

But why to call Data from Firebase if you can do it offline.

1 Like

So it can’t be Altered Easily by Clearing App Data.

That’s another case. If you want users to login in your app, then its fine. Otherwise, Tiny DB is recommended. :slight_smile:

1 Like

i have error , to make instant

It would really help if you provided a screenshot of your relevant blocks, so we can see what you are trying to do, and where the problem may be.

To get an image of your blocks, right click in the Blocks Editor and select “Download Blocks as Image”. You might want to use an image editor to crop etc. if required. Then post it here in the community.


1 Like

Uploading: blocks.png…

i am trying to set a clock that stops attempts, for 2 minutes
i have this error Runtime Error Argument to MakeInstant should have form MM/dd/YYYY

i did the test adding the date format, but i have the same error

1 Like

But @ADDYLIN what if User Changed the Device Time.
Accept it those Blocks were /are :poop:.

So, @ninowebs Follow @golumaths100 Suggestion, If you have No Issue with User Altering the Time.

Because You Are Using Clock7.Now As Instant, Which On DoIt Returns Something Like -

And Make Instant Only Accepts Arguments Of These 3 Format -
text (1)
text (2)

Again Only These Formats Are Accepted For Instant -
text (1)
text (2)

And What You Are Using Is :point_down:
text (3)

1 Like

even using these, it always gives me the same error

what about providing a screenshot of your latest blocks as well as the value of global variable terz?

use Do it to debug your blocks, see also tip 4 here App Inventor: How to Learn | Pura Vida Apps
see also Live Development, Testing, and Debugging Tools

1 Like

ok … I destroyed my project, I want to start from scratch , I have to make a clock, which blocks my app for 3 hours, using firebase

this is good too, but how can I set the button to work for 10 clicks and then this 10 minute block is activated