@capgo/background-geolocation
Main plugin interface for background geolocation functionality. Provides methods to manage location updates and access device settings.
Overview
Section titled “Overview”Main plugin interface for background geolocation functionality. Provides methods to manage location updates and access device settings.
Core Capabilities
Section titled “Core Capabilities”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).
Public API
Section titled “Public API”| Method | Description |
|---|---|
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). |
getPluginVersion | Get the native Capacitor plugin version. |
Source Of Truth
Section titled “Source Of Truth”This reference is synced from src/definitions.ts in capacitor-background-geolocation.