Adding Geofence Plugin
Add cordova-moengage-geofence plugin to Cordova project as shown below :
$ cordova plugin add cordova-moengage-geofence
Once you install the Flutter Plugin add MoEngage's native Android SDK dependency to the Android project of your application.
Navigate to android/app/build.gradle. Add the MoEngage Android SDK's dependency in the dependencies block.
implementation fileTree(dir: 'libs', include: ['*.jar'])
where $sdkVersion should be replaced by the latest version of the MoEngage Geofence SDK
In the case of iOS, the native dependency is part of the Geofence Cordova SDK itself, so there is no need to include any additional dependency for supporting Geofence.
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 the startGeofenceMonitoring() to receive location-triggered push messages.
Stop Geofence Monitoring
If you want to stop the geofence monitoring or feature use the stopGeofenceMonitoring() API. This API will remove the existing geofences.