I need some advice about how to logically proceed to limit the use of an app, I mean, as Shazam does: you can use it only for some times during a month, then you have to wait until next month for use it again. I’m doing it with Xcode and objective c.
How can I understand if the month is changed?
From a logical point of view, a basic method can be:
use a structure like:
and save in some option file (maybe with 0 as default).
when the application start, load the structure, then check the month. If it is 0, then is the first run, so set
and write it to the file.
If the month is greater than 0, then you use this code (I write some pseudo code here)
and save the file
Now, while the application is running, every x minutes (with x = 5 or 10) and when the application is quitting you use this code (again, pseudo code here)
this a stripped down version of what I do in my code when I needed something like that, but again: I am not working with XCode and/or Objective C but with C++ so this can be only an idea.