How to know if device time is altered by user

Hello everyone,

I'm currently working on an iOS app that relies on accurate time information even when the app is offline. I need to determine whether the device time is set to automatic or manual in such situations. Is there any way to programmatically detect this in iOS? My aim is to provide a warning or prompt the user to switch to automatic time if it's currently set to manual, ensuring the app functions correctly even in offline scenarios.

I have found few solutions but they are not completely working.

I would greatly appreciate any insights or suggestions on how to achieve this!

Thank you in advance!

Replies

Is there any way to programmatically detect this in iOS?

No.

This is what I call the secure timestamp problem and there isn’t a great solution. I encourage you to file an enhancement request for a new API for this, making sure to include a detailed description of your requirements. Please post your bug number, just for the record.

even when the app is offline.

This is the real challenge. The easy and obvious solution here is to run your own secure timestamp server, but that doesn’t help if you’re offline. You can find my thoughts on how to do this while offline here.

Share and Enjoy

Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@" + "apple.com"