A common exploit in casual games is to artificially advance the system clock to jump ahead in gameplay. How can such user clock advancement be detected by an app on an iOS device?
Ideally, the solution would be robust against reboots, but that is not a requirement.
Go to Settings > Screen Time. Tap See All Activity, then tap Week to see a summary of your weekly use, or tap Day to see a summary of your daily use.
Open the Settings app and tap General > iPhone or iPad Storage. On the next screen, you'll find useful information about your device, including storage space usage, recommendations on saving space, and a list of the installed apps. You'll also find the Last Used date, with apps never opened marked as Never Used.
CACurrentMediaTime & mach_absolute_time
Take a look at this questions:
iOS: How to measure passed time, independent of clock and time zone changes?
Calculating number of seconds between two points in time, in Cocoa, even when system clock has changed mid-way
CACurrentMediaTime uses mach_absolute_time: http://developer.apple.com/library/mac/#documentation/Cocoa/Reference/CoreAnimation_functions/Reference/reference.html
Here you have an example on how to use CACurrentMediaTime: http://www.informit.com/blogs/blog.aspx?b=02b4e309-308c-468a-bab1-cebb1404be6a
Here you have a more information on mach_absolute_time: http://developer.apple.com/library/mac/#qa/qa1398/_index.html http://shiftedbits.org/2008/10/01/mach_absolute_time-on-the-iphone/
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With