I'm implementing an app which works with a monthly subscription. Now, I need to validate whether the app has been paid for this month, for this I need to make regular checks against a server.
The question is, what is a correct way to validate, say, once per month? I could validate dates and verify that a month has passed, but the user could easily change the device's date time. I thought of having a usage counter, and after X usages, require the user to go online and connect to the server.
Is this a correct approach? or is there a safe way to obtain the system date and being sure that the user has not tampered with it?
Thank you.
You should do it by validating dates. Save the date in a sqlite db and every months (or whatever you like) check the license. Each time your app is starts or exits save the current datetime. If next time the system date is an earlier value then you know the time has been tampered with.
Took part of my answer here: How does my app tell if the current date is the real current date?