Open msacc-mas opened 1 month ago
The second option sounds the most obvious, but the reason I am asking is because I know starting and stopping location services may lead to cold boots of the GPS
It is fine. There’s nothing to be worried about. “Cold boots” of gps, as you call it, is not an issue.
This issue is stale because it has been open for 30 days with no activity.
Ionic React Capacitor App All latest versions of all dependencies.
We have a driver tracking app where we track the routes of transport drivers while they are in an active ride (they need to press start and complete ride buttons in the UI). We are using the built-in HTTP method in the plugin to auto sync the requests with our server .
We only want to send/ post locations to our server while they are in an active ride. We have two options to do this the way I understand it, and I would like a recommendation on the best way to do this
1) Call ready() then start() on application initialization so we start the plug-in when the application starts. In order to not send the locations to our server, we would Init the plugin with setConfig(persistMode: BackgroundGeolocation.PERSIST_MODE_NONE) -When the driver presses start ride, we would call setConfig(persistMode: BackgroundGeolocation.PERSIST_MODE_ALL) . And when they press complete ride, we could change it back to none.
2) We would call ready() on app initialization, And then call start() and stop() when the driver presses start ride or complete ride.
The second option sounds the most obvious, but the reason I am asking is because I know starting and stopping location services may lead to cold boots of the GPS, And I also am not sure if the plug-in is designed to be able to start and stop like that use case.
The first option feels more in line with the philosophy of how the plugin is designed (set it and forget it), But obviously that means we are tracking their location while they are not in a active ride and not doing anything with the location.