Background locations broken if distanceFilter enabled
PawelPlutaUek20 opened this issue · 2 comments
Describe the bug
addWatcher does not send the location if the distanceFilter option value is greater than 0.
To Reproduce
Steps to reproduce the behavior:
- Set distanceFilter to any value greater than 0
- The location is not sent in the background on android (it does in the foreground)
Expected behavior
send the location if the distance difference is greater than the specified value in distanceFilter
Smartphone (please complete the following information):
- Device: [e.g. iPhone6] Xiaomi redmi note 11
- OS: [e.g. iOS8.1] Android 11
Additional context
- I also tested it on an emulated device (Android studio, Pixel 2 and Pixel 6a)
- works on ios
- works on android in the foreground
- works on android in the background ( but only if distanceFilter is 0 )
package.json:
{
"@capacitor-community/background-geolocation": "^1.2.7",
"@capacitor/android": "^4.6.2",
"@capacitor/core": "^4.6.2",
"@capacitor/ios": "^4.6.2",
}
additional capacitor plugins:
plugins: {
CapacitorHttp: {
enabled: true,
},
},
I was not able to reproduce this problem with a distance filter of 10m, on my Samsung A52 running Android 12. Do you see the problem when you run the example app?
Thank you for the quick response, the error was actually caused by another plugin that I didn't have defined in the plugins (@capgo/capacitor-updater). I still didn't find the solution, but when I remove that plugin everything works fine. Great work btw!