Beacon Monitoring

Beacon Monitoring

Once you have integrated and initialized Locally’s Android and/or iOS EngageSDKs, you’ll be able to monitor nearby bluetooth low energy advertisements (aka beacons) for Locally content from right within your app!

Android Applications

Start Beacon Monitoring

private fun startMonitoring(){
            EngageSDK.startMonitoringBeacons() (radius //to monitor for nearby beacons  
        }

Monitor Geofences and Beacons at the Same Time

You can monitor Geofences and Beacons at the same time:

private fun startMonitoring(){
            EngageSDK.startMonitoringBeacons() //to monitor for nearby beacons 
            EngageSDK.startMonitoringGeofences(radius = 500, refresh = 600000)   
        }

Stop Beacon Monitoring

private fun stopMonitoring(){
            EngageSDK.stopMonitoringBeacons() 
        }

Listen for Events

To listen for events, set a listener override:


EngageSDK.setEventListener(object: EngageSDK.EventListener {
          override fun beaconCampaignUpdate(campaignContent: CampaignContent, time: String) {}

          override fun beaconUpdate(beacon: Beacon, time: String) {}

          override fun error(message: String, time: String) {}

          override fun geofenceCampaignUpdate(campaignContent: GeofenceCampaign.Campaign, time: String) {}

          override fun impressionUpdate(message: String, time: String) {}

          override fun locationUpdate(location: Location, time: String) {}
      })

iOS Applications

You can call Engage.startMonitoringBeacons from any place in your app.

The initialized closure is used to guarantee that startMonitoringBeacons is called only after the SDK has been initialized.

Engage.initialized = {
	Engage.startMonitoringBeacons()
}

Monitor Geofences and Beacons at the Same Time

You can monitor Geofences and Beacons at the same time:

Engage.initialized = {
Engage.startMonitoringBeacons()
	Engage.startMonitoringGeofences()
}