好的,所以我目前有一个应用程序,我在其中注册要使用该CLLocationManager
startMonitoringForRegion
方法监控的地理围栏。当应用程序位于前台和后台时,这可以正常工作。
我还设置了适当的 plist 值:
UIBackgroundModes :{location}
UIRequiredDeviceCapabilities: {location-services}
什么不起作用
设备重启后,应用程序不会重新启动。如果我startMonitoringSignificantLocationChanges
在进入后台之前设置,我可以强制这种情况发生。但是这种方法会消耗更多的电池寿命,而且我并不总是需要位置,只要我打破地理围栏。
地区的文档说:
In iOS, the regions you register with the location manager persist between launches of your application. If a region crossing occurs while your iOS app is not running, the system automatically wakes it up (or relaunches it) in the background so that it can process the event. When relaunched, all of the regions you configured previously are made available in the monitoredRegions property of any location manager objects you create.
问题
是否有可能(在使用地理围栏区域时)让系统在系统重新启动后重新启动我的应用程序,而不使用startMonitoringSignificantLocationChanges
?
编辑:我的目标是 iOS6 和 iOS7