How do I get a background location update every n minutes in my iOS application?

后端 未结 14 1158
佛祖请我去吃肉
佛祖请我去吃肉 2020-11-22 02:00

I\'m looking for a way to get a background location update every n minutes in my iOS application. I\'m using iOS 4.3 and the solution should work for non-jailbroken iPhones

14条回答
  •  名媛妹妹
    2020-11-22 02:05

    There is a cocoapod APScheduledLocationManager that allows to get background location updates every n seconds with desired location accuracy.

    let manager = APScheduledLocationManager(delegate: self)
    manager.startUpdatingLocation(interval: 170, acceptableLocationAccuracy: 100)
    

    The repository also contains an example app written in Swift 3.

提交回复
热议问题