Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to limit daily-usage even if user sets his clock back?

I have an IOS app that needs to track duration of free usage per day. Once it crosses a threshold, the user would have to purchase the app or wait for the next day to unlock his free-usage minutes for that day.

Is there a native way to detect if the user has set his clock back? Assume there is no Internet connection to sync with a time server

like image 968
S B Avatar asked Oct 09 '22 08:10

S B


1 Answers

UIApplicationDelegate can get the following method called on significant time changes:

- (void)applicationSignificantTimeChange:(UIApplication *)application

You can try that one. From my point of view, I'd recommend to check current date on every application launch or willBecomeActive and store those dates as list somewhere securely. If current date is different from the last date, add it to your list. If list has more than 30 items (or how many you need) disable trial functionality.

like image 52
Denis Avatar answered Oct 13 '22 10:10

Denis