Location Triggered

To integrate Geofence, Go to Unity Editor, navigating to Assets > Import Package > Custom Package and import the Geofence.unitypackage. The package is part of the .zip file you downloaded during installation.

Screenshot 2023-08-11 at 11.16.46 AM.png


Add MoEGeofenceGameObject.cs to the same object created in the Unity Initialization step and set the App Id

Screenshot 2023-08-17 at 2.05.15 PM.png

Android Configuration

Prerequisites for Geofence

To use geofencing, your app must request the following:

  • ACCESS_BACKGROUND_LOCATION if your app targets Android 10 (API level 29) or higher


For Geofence pushes to work your Application should have location permission and Play Services' Location Library should be included.

Refer to the documentation for more details on Geofence.

iOS Configuration

Post integration with the geofence package make sure to  Build and Replace for iOS.


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

using MoEngage;

Stop Geofence Monitoring

If you want to stop the geofence monitoring or feature use the StopGeofenceMonitoring() API. This API will remove the existing geofences.

using MoEngage;



Was this article helpful?
0 out of 0 found this helpful

How can we improve this article?