Geofence

Monitors circular geofences around latitude/longitude coordinates, and sends a notification to the user when the boundary of a geofence is crossed. Notifications can be sent when the user enters and/or exits a geofence.
Geofences persist after device reboot. Geofences will be monitored even when the app is not running.

notification: Object. Options for defining the notification sent when a geofence is crossed

id: Any unique ID

title: Notification title

text: Notification body

openAppOnClick: Boolean. Whether to open the app when the notification is tapped by the user

Troubleshooting

I get compile errors when I run ionic build ios or ionic run ios.

This could be caused by the Cordova project directory in /platforms/ios not being named correctly.
Try running ionic cordova platform rm <platform> then run ionic cordova platform add <platform> to recreate the
platform directories.

Instance Members

TransitionType

onTransitionReceived()

Subscribe to get notified when a transition is received

Returns:Observable<any>

initialize()

Initializes the plugin. User will be prompted to allow the app to use location and notifications.

Returns:Promise<void>

addOrUpdate()

Adds a new geofence or array of geofences. For geofence object, see above.

Returns:Promise<void>

remove()

Removes a geofence or array of geofences. geofenceID corresponds to one or more IDs specified when the
geofence was created.

Returns:Promise<void>

removeAll()

Removes all geofences.

Returns:Promise<void>

getWatched()

Returns an array of geofences currently being monitored.

Returns:Promise<Array<string>>

onNotificationClicked()

Called when the user clicks a geofence notification. iOS and Android only.