Search code examples
ioscore-locationgeofencing

CoreLocation "significant location changes" vs. "region monitoring"


Goal:

I want an app that will give the user a location notification when they are near a location of interest. (For instance, "you are within 100ft of XYZ")

The Core Location documentation stresses that the low-battery-impact way of monitoring location is with -[CLLocationManager startMonitoringSignificantLocationChanges]. This does not appear to require the app to run with UIBackgroundModes.

Does the same thing apply for region monitoring? I want to use [CLLocationManager startMonitoringForRegion:] -- I can't tell from the documentation whether the app has to run in the background to receive geofencing updates. I want to have as little drain on the user's battery as possible.

Hopefully that makes sense.


Solution

  • startMonitoringForRegion is exactly what you want. The app doesn't need to be running in the background, it will be woken to handle any updates from the OS.