Installation
To add MoEngage Geofence SDK to your application, edit the application’s pubspec.yaml file and add the below dependency to it:This plugin is dependent on moengage_flutter plugin. Make sure you have installed the moengage_flutter plugin as well. Refer to the doc for the same.For location-triggered push to work, ensure your Application has:
- Location permission
- Play Services Location Library
- The device’s location should be enabled
Android Installation
Starting moengage_geofence5.0.0 the plugin includes the native dependency, so there is no need to include any additional native dependency.iOS Installation
In the case of iOS, the native dependency is part of the Geofence flutter SDK itself, so there is no need to include any additional dependency for supporting Geofence.Configuration
Start Geofence Monitoring
After integrating the geofence package call startGeofenceMonitoring() method to initiate the geofence module, this will fetch the geofences around the current location of the user. Please take a look at the iOS doc and Android doc for more information on Geofence. By default, the geofence feature is not enabled. You need to call startGeofenceMonitoring() to receive location-triggered push messages.Call
startGeofenceMonitoring() only after the SDK is initialized and location permission has been granted. If the SDK is not initialized, the call is ignored silently.