Use blocks to give your users trial only for three days or more free to use your app

Hello koders imagine I have the app which I haven’t published on play store and I think I will not.

But I want to give my users a trial which will only last for 3 Days this means I should set the blocks as when the Ask Admin Button or menu clicks a notifier will Popup and will come with two buttons Subscribe_Btn & Trial_Btn then when if the trial_Btn is clicked it will call the time to start counting and every time when the Ask Admin button or menu clicks it should check if the counting time is greater than 48 hrs then the a notifier will Popup and at this time will come with only one button Subscribe_Btn and Trial_Btn should be set to false.

Please great koders I need you help, since I have searched for this solution and found this wonderful post

but I didn’t understand it clear see what I have tried it with blocks

Please I know the rule is to try then ask if you failed, :pray: I have real total failed I don’t know how to solve it.

2 Likes

In the documentation of the extension used I read
“DateTools1.CurrentDateTime: Returns device’s current date and time”

Checking call DateTools1.CurrentDateTime > 48 in your blocks, you probably mean 48 hours.
I suppose function DateTime gets as argument milliseconds (not hours).

1 Like

@nikif99 please I want to give for only 48 hours means three days.
Please can you solve it.?

I do not use the extension you mention.

By my experience with the built-in component Clock, time counts in milliseconds for maximun accuracy (1 sec=1000 ms).
So, your trial period of 48 h should be expressed as 48x60x60x1000.

Another point you have to note is that time starts January, 1, 1970, when time = 0. Elapsed time (in ms) counts since then.
http://ai2.appinventor.mit.edu/reference/components/sensors.html#Clock

I made a simple example showing that.

test_4.aia (2.2 KB)

Hope that it will help you.

The user can simply trick the app by changing the Time & Date in the settings app.

Checking online time will eliminate users to cheat.

Correct, use this tutorial:

@Boban I think you should close this topic now as it’s been more than a month anyone has replied

there is no need to remind others to close a thread… thank you…
Taifun

1 Like

Continuing the discussion from Use blocks to give your users trial only for three days or more free to use your app:

How to make it run in background and automatically stop it after 7 days, Pls help.

Thank You

use this:

ok thank you