Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How reliable is using TrueTime for getting device independent time?

Tags:

ios

swift

ntp

I recently found a library called TrueTime for getting the time which does not depend on device time. It uses NTP to get the time.

https://github.com/instacart/TrueTime.swift

As this library is primarily built for swift 3. But I found a post in which there were some changes made in files to make it swift 4 compatible.

https://github.com/instacart/TrueTime.swift/issues/39

As I am using swift & using pod for this library. I unlocked the pods & made changes in the library to make work with swift 4.

How reliable is this library?

My concerns are

  1. Apple approval after submitting an app.

  2. Support for coming swift & iOS versions.

Are there better alternatives to this library?

like image 254
TechChain Avatar asked Oct 28 '22 20:10

TechChain


1 Answers

Apple definitely won't reject that. It's not in the Review Guidelines. I even have an app that uses TrueTime on the app store.

Regarding reliability, if you mean reliability by "how reliable it is to get correct true time", then it's quite reliable. It seems like that the library gets the time from time.apple.com. That seems to be from Apple, so I would say you can rely on it.

If you mean reliability by "how reliable it is to make successful requests" then that depends a lot: the user's Internet connection, bugs in the TrueTime library etc. According to the README,

  • Reachability events are automatically accounted for to pause/start requests.

  • UDP requests are executed in parallel, with a default limit of 5 parallel calls. If one fails, we'll retry up to 3 times by default.

So that's how the requests will behave.

like image 139
Sweeper Avatar answered Nov 15 '22 06:11

Sweeper