Check if device install dates are set in iOS

Is there a way to check if device parameters for "date and time" are set automatically or not in Swift? And if there is, is it possible to force the user to switch to the desired settings (automatically)

+3


source to share


1 answer


As iOS is structured, your application lives in a sandbox and can only communicate with the system if there is a public API that Apple has shared with the developer community. Some public APIs are free to use like an accelerometer, but others require user permission, such as location information. Unfortunately the apis date and time settings are not public, so you cannot play with the date and time settings.

There are many posts on how to get time in anti-tamper mode. The bottom line is that there is no real 100% proof of protection against unauthorized access, but the following code is already a good step to protect against most users.

#import <CoreLocation/CoreLocation.h>

CLLocation* gps = [[CLLocation alloc]
                   initWithLatitude:(CLLocationDegrees) 0.0
                   longitude:(CLLocationDegrees) 0.0];
NSDate* now = gps.timestamp;

      



Many other resources, but take a look at these two:

+1


source







All Articles