Add Beacons

1. Add AltBeacon and Google Play Service Location Dependency to your build

To be compatible with the current version of the SDK, replace {currentBeaconVersion} with 2.16.1, and replace {currentLocationVersion} with 16.0.0. These versions have been tested with the latest version of the SDK. Behavior is not guaranteed if you use a different version of either dependency.

2. Add these permissions to your application’s AndroidManifest.xml

3. Enable beacon messaging during SDK initialization

To troubleshoot information related to beacons in the InitializationStatus that is returned during the SDK’s initialization call, see initialization status documentation.

4. Enable beacon messaging at runtime

You must request the runtime location permission before calling the following code. See Request App Permissions for more information.

Once the permission is granted you can enable beacon notification by calling enableProximityMessaging().

You can disable beacon notifications by calling disableProximityMessaging().

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, see the MobilePush beacons help documentation.

Add Debug Logging for Beacons

Proximity logging is off by default. To turn it on, use AltBeacon’s LogManager class. Our AltBeacon Logger implementation sends their logs through our internal logging interface. Use the following example code as a guide.