Background recording is not working well
See original GitHub issueYour Environment
- Plugin version: 3.0.0-alpha.40
- Platform: Android
- OS version: 7.2
- Device manufacturer and model: Xiomi Redmi 4
- Cordova version (
cordova -v
): 8.0.0 - Cordova platform version (
cordova platform ls
): 7.0.0 - Plugin configuration options:
- Link to your project: https://github.com/IsraelHikingMap/Site/tree/master/IsraelHiking.Web
Context
I wanted to be able to record a route while the application is in the background, but I get bad results 😕
Expected Behavior
Geo-location should be measured in the required intervals with the relevant distance filter
Actual Behavior
Geo location is measure sporadically and is inaccurate
Possible Fix
I would love to help out, but I have no clue
Steps to Reproduce
I’ve copied most of the code from the example, see here:
https://github.com/IsraelHikingMap/Site/blob/master/IsraelHiking.Web/sources/application/services/geo-location.service.ts
The project above can be complied using npm run build -- -c android
and then packed to apk (cordova run android) to debug locally.
I made sure the battery setting for the app is “no limitation”.
Context
I’m trying to convert the site I currently maintain: https://israelhiking.osm.org.il/ To be able to record a route when the application is in the background and I can’t achieve it using only the browser (as far as I know).
Debug logs
Probably better if you reproduce it locally, in case this is problematic I’ll be glad to try and extract logs from my device.
Here is how the recording looks, can be found here: https://israelhiking.osm.org.il/share/g5dzPscL9t
It might be that I wrote the code wrong, but from the readme it looks fine…
Issue Analytics
- State:
- Created 5 years ago
- Comments:6
Top GitHub Comments
I have changed
locationProvider
fromBackgroundGeolocation.DISTANCE_FILTER_PROVIDER
toBackgroundGeolocation.RAW_PROVIDER
and it seems to solve this. Never-the-less I think the above is a workaround and not the right fix, IMOYes, I haven’t changed the configuration since I posted this comment. I think raw provider uses interval and fastest interval add far as I could observe but it works be better to check with the maintainer of this plugin.