Getting GPS satellites and atomic clock time stamp in iOS

痞子三分冷 提交于 2019-12-08 08:45:25

问题


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.


回答1:


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.




回答2:


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

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