Skip to content

@capgo/background-geolocation

Accurate background location tracking, native geofence enter/exit events, and transition webhooks for Capacitor apps.

Use @capgo/background-geolocation when your Capacitor app needs precise location updates in the foreground or background, native circular geofences on iOS and Android, and backend delivery for geofence transitions when the WebView is suspended.

  • start - Stream accurate foreground or background location updates.
  • stop - Stop active location tracking cleanly.
  • openSettings - Send users to native location settings when permissions need attention.
  • setPlannedRoute - Play a native sound when the user deviates from a planned route.
  • setupGeofencing - Configure native geofence defaults and optional transition webhook delivery.
  • addGeofence - Monitor a circular iOS or Android geofence region by identifier.
  • removeGeofence / removeAllGeofences - Stop monitoring one or all registered geofences.
  • getMonitoredGeofences - List region identifiers currently monitored by the native layer.
  • geofenceTransition listener - Receive enter and exit events while the app is active.
  • geofenceError listener - Handle native monitoring errors without changing the transition event shape.
MethodDescription
startStreams accurate foreground or background location updates.
stopStops location updates.
openSettingsOpens the device’s location settings page. Useful for directing users to enable location services or adjust permissions.
setPlannedRoutePlays a native sound when the user deviates from a planned route.
setupGeofencingConfigures geofence defaults and optional native transition POST delivery.
addGeofenceStarts monitoring a circular geofence on iOS and Android.
removeGeofenceStops monitoring one geofence by identifier.
removeAllGeofencesStops monitoring all geofences registered by this plugin.
getMonitoredGeofencesReturns the identifiers currently monitored by the native layer.
addListener('geofenceTransition', ...)Receives geofence enter and exit events while the app is alive.
addListener('geofenceError', ...)Receives native geofence monitoring errors while the app is alive.
getPluginVersionGet the native Capacitor plugin version.

This reference is synced from src/definitions.ts in capacitor-background-geolocation.