在后台完美运行应用程序17 - 18分钟后,没有调用didUpdateLocations。我已经检查了位置更新选项,以使应用程序在后台运行。应用程序运行15 - 20分钟,然后didUpdateLocation停止在后台调用。
请帮忙
答案 0 :(得分:3)
感谢您发布解决方案。在Swift 3中,我设置了pausesLocationUpdatesAutomatically = false,它似乎运行得很好。
let manager = CLLocationManager()
manager.desiredAccuracy = kCLLocationAccuracyBest
manager.delegate = self
manager.requestWhenInUseAuthorization()
manager.allowsBackgroundLocationUpdates = true
manager.pausesLocationUpdatesAutomatically = false