> ## Documentation Index
> Fetch the complete documentation index at: https://moengage.com/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Location Triggered

> Add geofence-based location-triggered push notifications to your Cordova app using MoEngage.

# Installation

## Adding Geofence Plugin

Add **cordova-moengage-geofence** plugin to Cordova project as shown below :

<CodeGroup>
  ```auto Shell theme={null}
  $ cordova plugin add cordova-moengage-geofence
  ```
</CodeGroup>

## Android Installation

## Install using BOM

Integration using BOM  is the recommended way of integration; refer to the [Install Using BOM ](/developer-guide/android-sdk/sdk-integration/basic-integration/Install-Using-BOM)document. Once you have configured the BOM add the dependency in the *app/build.gradle* file as shown below:

<CodeGroup>
  ```json build.gradle wrap theme={null}
  dependencies {
      ...
      implementation("com.moengage:geofence")
  }
  ```
</CodeGroup>

Once the BOM is configured, include the specific MoEngage modules required for the application. \
Note: Version numbers are not required for these dependencies; the BOM automatically manages them.

## Manual Installation

![Download](https://img.shields.io/maven-central/v/com.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.

<CodeGroup>
  ```json build.gradle theme={null}
  dependencies {
      implementation fileTree(dir: 'libs', include: ['*.jar'])
      implementation("com.moengage:geofence:$sdkVersion")
  }
  ```
</CodeGroup>

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

## iOS

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.

## 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](/developer-guide/ios-sdk/push/optional/location-triggered) and [Android doc](/developer-guide/android-sdk/push/optional/location-triggered) 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. 

<CodeGroup>
  ```auto Javascript theme={null}
  MoEGeofence.startGeofenceMonitoring("YOUR_Workspace_ID");
  ```
</CodeGroup>

### Stop Geofence Monitoring

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

<CodeGroup>
  ```javascript Javascript wrap theme={null}
  MoEGeofence.stopGeofenceMonitoring("YOUR_Workspace_ID");
  ```
</CodeGroup>
