Can we use clock_gettime_nsec_np(CLOCK_MONOTONIC_RAW) in IOS?

Hello! We develop IOS application and it’s necessary for us to check if user changed the device time in Device settings or not. We use function "clock_gettime_nsec_np(CLOCK_MONOTONIC_RAW)" to check time and it works perfect. But I saw this function only here in Documentation(in discussion section): https://developer.apple.com/documentation/kernel/1646199-mach_continuous_time and this is for Mac OS so I want to know if I can use this function in IOS application that we are going to submit to App Store or we can face with some problems? For example this function can not work on some iPhones or on some IOS or we can have some problems during the review the application in App Store? Or maybe there are some alternatives function "clock_gettime_nsec_np(CLOCK_MONOTONIC_RAW)" for IOS?

We tried to use ProcessInfo.processInfo.systemUptime but it counts only when device is awaken. So we can't use it to check if user changed the device time in Device settings or not.(

Thank you for any help in advance!

Accepted Reply

I want to know if I can use this function in iOS application that we are going to submit to App Store or we can face with some problems?

I don’t work for App Review and can’t offer definitive answers about their policy. However, the situation with this API is quite clear cut and you are simply being mislead by limitations of our documentation system )-:

I’ve seen folks confused by this many times before in the past, so I decided to write this up properly. See Availability of Low-Level APIs.

Share and Enjoy

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

Replies

I want to know if I can use this function in iOS application that we are going to submit to App Store or we can face with some problems?

I don’t work for App Review and can’t offer definitive answers about their policy. However, the situation with this API is quite clear cut and you are simply being mislead by limitations of our documentation system )-:

I’ve seen folks confused by this many times before in the past, so I decided to write this up properly. See Availability of Low-Level APIs.

Share and Enjoy

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