Location Triggered
Follow

Installation

To add MoEngage Geofence SDK to your application run the below command from a terminal

npm install react-native-moengage-geofence

Note: This plugin is dependent on react-native-moengage plugin. Make sure you have installed the react-native-moengage plugin as well.

Android Installation

MavenBadge

In android/app/build.gradle add the following

Groovy
dependencies {
    ...
    implementation("com.moengage:geofence:$sdkVersion")
}

where $sdkVersion should be replaced by the latest version of the MoEngage Geofence SDK.

 

NOTE

For location triggered push to work, ensure your Application has:

  • Location permission
  • Play Services Location Library
  • Device's location should be enabled

iOS Initialization

Refer to the doc for more information on Geofence.

Configure Geofence

By default, the geofence feature is not enabled. To enable the feature call the below API.

TypeScript
import ReactMoEGeofence from 'react-native-moengage-geofence';

ReactMoEGeofence.startGeofenceMonitoring(YOUR APP ID);

At any time if you want to stop the geofence monitoring or feature use the below API. This API will remove the existing geofences.

TypeScript
import ReactMoEGeofence from 'react-native-moengage-geofence';

ReactMoEGeofence.stopGeofenceMonitoring(YOUR APP ID);
Was this article helpful?
0 out of 0 found this helpful