Countdown Timer for a Download - Make Download Button Visible After 3 Hours

I have a Easter Hidden Object game with a special bonus for the children of the buyers of the app. When they click a button, they can download 3 x coloring Easter pictures. In the former version, I had this when the score reached ten points and also a download button in the parents area of the app for the coloring Easter Pictures.

Unfortunately, many Google Play customers have bought the app, fast they downloaded the 15 coloring Easter pictures and then they made a refund in these 2 hours where it is possible. I am disappointed.

So, I decided to make a Countdown Timer with 3 hours in seconds (or milliseconds?) which first shows the download buttons when 3 hours have gone, so that the customers cannot refund the app anymore.

There are three game areas with a table arrangement and ten buttons. The children have to find the hidden objects.

I tried to code such a countdown timer, but unfortunately, I failed. The button did not appear after the 10800 seconds, which should be three hours. To avoid further refunds, could someone please help me to program such a timer for the visibility of the gift buttons? I only have beginner's knowledge, so I would appreciate a code example, if perhaps possible. Thank you! Here is a screenshot of my code:

Thank you so much.


If you don't save time in a persistent way your count down doesn't work. If the app is closed your clock code doesn't work because doesn't run in background.
Probably the best way is to save in tinyDb or on line if you can the right value. Example when user starts game you save the date + 3 hours . In gift code you have to add if date of now is bigger than the saved date then show gift
There is in the clock block the add hours

Thank you very much!

1 Like

Now I'm not at pc but if you post block I can check them :+1:t2:

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.