Geofence and Beacon Messaging
If location is enabled in your MarketingCloudSDKConfiguration.json file, you can call a single method to use the Marketing Cloud location messaging feature.
In addition, Apple requires adding keys to your Info.plist file to enable location services:
Review the Apple documentation for more information.
MarketingCloudSDK requires “Always” permissions for full geofence and beacon functionality. An application does not receive location messages if “When-in-use authorization” is selected by the app user.
When your application is ready to enable location features, including geofence and beacon messaging, call the MarketingCloudSDK framework’s method to start watching location.
The MarketingCloudSDK+Location.h” header file details additional methods to get information about location and control the frameworks behavior.
MobilePush prevents the app from displaying a geofence message with an empty alert. If you include AMPscript in your message that returns no content or an empty string, the mobile app does not display that message.
We enable beacon support when you implement the location requirements on this page.
To range for beacons in the background, add an entry to your app’s Info.plist. This permission ensures that your app can range for beacons when your app is in the background or suspended.
Implement this key to enable this function. “App registers for location updates” is required to enable location in the MarketingCloudSDK and to range for beacons in the background.
MobilePush prevents the app from displaying a beacon message with an empty alert. If you include AMPscript in your message that returns no content or an empty string, the mobile app will not display that message.
To understand how beacons behave in different situations, review the MobilePush beacons help documentation (http://help.marketingcloud.com/en/documentation/mobilepush/beacons_overview/beacon_behavior/).
If you create your own CLLocationManager object, we cannot guarantee that features of our SDK will work as intended.
If you have enabled notifications using MarketingCloudSDK and have called -sfmc_startWatchingLocation, you can access the device’s last known location using the SDK.