Geofencing Module

Enabling the Module

You can enable it as described here.

Getting the Necessary Permissions

You should add the permissions below into your AndroidManifest.xml file to run Geofencing module.

<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" /> <uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" /> <uses-permission android:name="android.permission.ACCESS_BACKGROUND_LOCATION" />

You can call the method below, to request these permissions in run time.

Kotlin

RelatedDigital.requestLocationPermission(your_activity)

Java

RelatedDigital.requestLocationPermission(your_activity);

 

Running the Module

After adding the necessary permissions into the AndroidManifest.xml file(granting them from the user) and enabling the module via setIsGeofenceEnabled() method, it will automatically starts running. There is nothing else you need to do. The SDK will check the Geofences and Geofencing targeting actions you defined on RMC panel regularly (even when the app is closed). According to the rule of the action you defined, the user will get the related notification when he/she enters to the region, stays in the region for a while, or leaves the region.

Example Application

RelatedDigital Example Application

Copyright 2020 Related Digital