Skip to content

@capgo/background-geolocation

Main plugin interface for background geolocation functionality. Provides methods to manage location updates and access device settings.

Main plugin interface for background geolocation functionality. Provides methods to manage location updates and access device settings.

  • start - To start listening for changes in the device’s location, call this method. A Promise is returned to indicate that it finished the call. The callback will be called every time a new location is available, or if there was an error when calling this method. Don’t rely on promise rejection for this.
  • stop - Stops location updates.
  • openSettings - Opens the device’s location settings page. Useful for directing users to enable location services or adjust permissions.
  • setPlannedRoute - Plays a sound file when the user deviates from the planned route. This should be used to play a sound (in the background too, only for native).
MethodDescription
startTo start listening for changes in the device’s location, call this method. A Promise is returned to indicate that it finished the call. The callback will be called every time a new location is available, or if there was an error when calling this method. Don’t rely on promise rejection for this.
stopStops location updates.
openSettingsOpens the device’s location settings page. Useful for directing users to enable location services or adjust permissions.
setPlannedRoutePlays a sound file when the user deviates from the planned route. This should be used to play a sound (in the background too, only for native).
getPluginVersionGet the native Capacitor plugin version.

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