Our documentation is changing, please click here to enjoy it!

Skip to end of metadata
Go to start of metadata

To get to know more about Geofencing check out the User Guide.

Integration

To integrate Geofencing, add the dependency for  google-play-services-geofence  to you a pp-level build.gradle  file:

Retrieve Geofences from BroadcastReceiver

Each time a user enters or exits a geofence zone defined in the Accengage User Interface, your app may receive their specific information (like latitude, longitude, etc).

Create a BroadcastReceiver

To receive them, you should first create a BroadcastReceiver:  

GeofenceReceiver.java

Modify your AndroidManifest.xml

Now, we have to add our “GeofenceReceiver” class to the AndroidManifest.xml in order to allow the SDK to trigger it when needed:

AndroidManifest.xml

Retrieving Geofences from ContentProvider

Since the version 3.5.0 geofences could be retrived from ContentProvider using A4SContract with specified URI. The code snippet instantiating a CursorLoader is shown below:

From version 3.5.0

For more details please see A4SGeofences sample (v3.5.0 is required) allowing to list geofences and sort them by name, distance, radius, detected count,... in ascending/descending order.

  

Sample

A sample is available on Github: https://github.com/Accengage/accengage-android-sdk-samples/tree/master/AccGeofences 

  • No labels