iOS 位置 - iOS 中的显着位置变化 8/9 可以启动标准位置服务吗?

iOS Location - Significant Location Change in iOS 8/9 can start standard location service?

这里有很多关于iOS位置追踪的问题,但最近苹果更新了很多功能,所以很多答案都过时了,我的问题专门针对iOS 8和 9.

我有兴趣创建一个位置跟踪应用程序,即使在应用程序关闭时也能准确跟踪用户。为此,苹果声明:

If you leave the significant-change location service running and your iOS app is subsequently suspended or terminated, the service automatically wakes up your app when new location data arrives. At wake-up time, the app is put into the background and you are given a small amount of time (around 10 seconds) to manually restart location services and process the location data.

所以我的理解是,如果您拥有所有必要的权限和 plist 密钥,OS 将唤醒您的应用程序并允许您做某事 10 秒,或者如果它需要更多时间它可以:

If an iOS app needs more time to process the location data, it can request more background execution time using the beginBackgroundTaskWithName:expirationHandler: method of the UIApplication class.

现在,这表示如果我的应用程序需要更多时间来处理位置数据,它可能会启动一个后台任务(带有 expirationHandler)来处理它。在阅读后台任务时,我读到后台任务可以 运行 最多 10 分钟

所以我的总体问题是,当我的应用程序在 显着位置变化 发生时被唤醒时,是否可以启动 标准位置服务 并无限期地在后台 运行?是否可以在第一个后台任务到期之前启动另一个后台任务?

编辑:Apple Documentation 它说:

because it wakes the system and your app at least every 15 minutes, even if no location changes have occurred, and it runs continuously until you stop it

所以我的想法是,如果用户从无到有开始他们的 phone 并且从未打开应用程序,最多 15 分钟后(即使他们站着不动),OS 将触发我的应用程序,在这种情况下,我可以启动一个后台进程,我可以在其中启动 GPS 跟踪,从而获得 准确的 GPS 位置 。此逻辑是否适用于 OS?

主要问题是位置的重大变化不能用于 "accurately track" 用户。
重要意味着 1000 米,因为它是基于手机信号塔的,而不是基于 GPS 的。 因此,当用户移动到下一个 GSM 小区时,您的应用程序就会被唤醒。
这对于精确跟踪来说不够精确。

最后,这意味着您无法在应用关闭时进行准确跟踪,这仅适用于 运行 应用或后台 运行 以上。

"When reading about background tasks, I read that background tasks can run for a maximum of 10 minutes"

不,那不是真的。我的应用程序在后台运行并记录 GPS 位置,直到电池耗尽 (8h+)。 (不使用显着位置模式)