简体   繁体   中英

GPS location updates in CLLocationmanager

我正在开发一个应用程序。我正在使用CLLocation Manager获取位置更新。我知道当我调用开始位置更新方法gps时关闭,而当我们调用停止位置更新gps时关闭。但是我想关闭GPS,我仍然想使用手机信号塔或wifi.wifi来获取位置更新。

You can use the desiredAccuracy property of CLLocationManager to tell the system how accurate the location needs to be. You don't have control over whether GPS gets turned on or not, but setting the desiredAccuracy to a lower accuracy consumes less power.

From the CLLocationManager Class Reference :

The receiver does its best to achieve the requested accuracy; however, the actual accuracy is not guaranteed.

You should assign a value to this property that is appropriate for your usage scenario. In other words, if you need the current location only within a few kilometers, you should not specify kCLLocationAccuracyBest for the accuracy. Determining a location with greater accuracy requires more time and more power.

When requesting high-accuracy location data, the initial event delivered by the location service may not have the accuracy you requested. The location service delivers the initial event as quickly as possible. It then continues to determine the location with the accuracy you requested and delivers additional events, as necessary, when that data is available.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM