Is it possible to get the GPS atomic clock time stamp in iOS? Also, is it possible to see which satellites were used in a certain sample?
As far as I know GPS receivers get this info, but I didn't find any way to get access to it.
iOS is not providing any such public APIs to access those details.
As per Apple documents:
A location manager object provides support for the following location-related activities:
Tracking large or small changes in the user’s current location with a configurable degree of accuracy.
Reporting heading changes from the onboard compass. (iOS only)
Monitoring distinct regions of interest and generating location events when the user enters or leaves those regions.
Deferring the delivery of location updates while the app is in the background. (iOS only)
Reporting the range to nearby beacons.
Nowhere it says about GPS atomic clock time stamp.
This works to get the GPS time:
#import <CoreLocation/CoreLocation.h>
CLLocation* gps = [[CLLocation alloc]
initWithLatitude:(CLLocationDegrees) 0.0
longitude:(CLLocationDegrees) 0.0];
NSDate* now = gps.timestamp;
I haven't seen anything that would lead me to believe you could get the satellite numbers through the official API. Perhaps through unpublished methods? But fwiw that would exclude your app from the App Store.
来源:https://stackoverflow.com/questions/14559583/getting-gps-satellites-and-atomic-clock-time-stamp-in-ios