Enable Background Location Updates

Normally, the app downloads new regions and messages as the device moves more than 5 kilometers from the last location and download of this data. However, if your app serves users who spend much time within a single 5-kilometer radius, consider adding the ability to do a background refresh of regions and messages. Apple controls when this background refresh takes place. However, Apple also allows the SDK to download new regions and messages for those times your user spends a considerable amount of time in a single 5-kilometer region.

In your Info.plist, implement this key to enable this function. To refresh geofences and beacons, the SDK requires the app to implement the App downloads content from the network mode. This mode gives the app permission to periodically download new regions and messages.

In your Info.plist, add keys under UIBackgroundModes:

In your application delegate method -application:didFinishLaunchingWithOptions:, implement this code:

Finally, implement the handler for this functionality in your application delegate class.

For SDK v10 and later, use this code.

For SDK v8, use this code.

For SDK v7, use this code.

See MarketingCloudSDK+Base.h for more information about this method.