UIBackgroundModes location and significant location changes with region monitoring

浪尽此生 提交于 2019-11-30 01:56:47

You're right about the location key, it's only required when your app needs high-precision location updates even when in the background. Something like Runkeeper uses this to allow it to keep tracking your location, even when you're using another app with multitasking. From the docs for iOS Keys: UIBackgroundModes

"location": The app provides location-based information to the user and requires the use of the standard location services (as opposed to the significant change location service) to implement this feature.

And

Where alternatives for running in the background exist, those alternatives should be used instead. For example, apps can use the signifiant location change interface to receive location events instead of registering as a background location app.

Region monitoring will work without the location key. In fact, region monitoring will work without any special iOS keys being enabled.

You say that you're not using CLLocationManager, but if you're using region monitoring, you'll have to use that class. You need to set up a location manager delegate for your app to actually get the region notifications.

Yes, you must need to add "location" key under Backround modes in Info.plist if you are using significant change location service (startMonitoringSignificantLocationChanges) to monitor user location in the background and in the app kill state.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!