Open usmaanirfan opened 8 years ago
What time host are you using? If it doesn't exist or doesn't respond, you'll get this behavior. Remember that NTP is a UPD (datagram) protocol; unlike TCP it is not obliged to report network errors so your application will need to deal with them.
not able to get network time it always shows device time.
What time host are you using? The default is NO host and this behavior.
I was having same problem, I solved it by placing below method call in application:didFinishLaunchWithoptions:
NetworkClock * networkClock = [NetworkClock sharedNetworkClock];
But it introduced a new problem, First time I was able to fetch correct network time, but as soon as application went in background and came to foreground same issue arises.
I tried to place above call in applicationWillEnterForeground:
as well in applicationDidBecomeActive:
, but did not found solution for above problem
I am using this host in ntp.hosts file in.pool.ntp.org Edit: I tested with time.apple.com and found, its not reliable.
iOS-ntp returning same value as device, when i change device time network time change as well please help what m i missing? as i check didReceiveData not get called in NetAssociation.