How can I get the “internet time” on iOS? [duplicate]

无人久伴 提交于 2019-12-10 09:17:21

问题


So, I'm developing an app that is based on the time, but with NSDate an user can easily hack the application by changing system time of the device. So I might want to use a better method for retrieving time.

How can I do this? Is there an easy way to retrieve time from internet?


回答1:


Checkout this Google Library: https://github.com/jbenet/ios-ntp

After the library is set up you can use it with the following line:

[NSDate networkDate];

A similar question has also been answered here: Get Date and Time from Apple Server



来源:https://stackoverflow.com/questions/27155106/how-can-i-get-the-internet-time-on-ios

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!