php实现个人轨迹跟踪,最近刚上架了一款记录个人轨迹的 App

20

2018-08-14 09:38:03 +08:00

@loveour 没你想的那么麻烦。 设置一下更新距离和多长时间更新一次。就可以了。

使用的这个 API 接口,- (void)allowDeferredLocationUpdatesUntilTraveled:(CLLocationDistance)distance

timeout:(NSTimeInterval)timeout。

接口文档

/*

*allowDeferredLocationUpdatesUntilTraveled:timeout:

*

*Discussion:

* Indicate that the application will allow the location manager to defer

* location updates until an exit criterion is met. This may allow the

* device to enter a low-power state in which updates are held for later

* delivery. Once an exit condition is met, the location manager will

* continue normal updates until this method is invoked again.

*

* Exit conditions, distance and timeout, can be specified using the constants

* CLLocationDistanceMax and CLTimeIntervalMax, respectively, if you are

* trying to achieve an unlimited distance or timeout.

*

* The CLLocationManagerDelegate will continue to receive normal updates as

* long as the application remains in the foreground. While the process is

* in the background, the device may be able to enter a low-power state for

* portions of the specified distance and time interval. While in this

* state, locations will be coalesced for later delivery.

*

* Location updates will be deferred as much as is reasonable to save

* power. If another process is using location, the device may not enter a

* low-power state and instead updates will continue normally. Deferred

* updates may be interspersed with normal updates if the device exits and

* re-enters a low-power state.

*

* All location updates, including deferred updates, will be delivered via

* the delegate callback locationManager:didUpdateLocations:

*

* When deferred updates have ended, the manager will invoke the delegate

* callback locationManagerDidFinishDeferredUpdates:withError:. An error

* will be returned if the manager will not defer updates and the exit

* criteria have not been met.

*/

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值