Closed emil-alexandrescu closed 2 years ago
The addWatcher function no longer returns a watcher ID, it returns a Promise which resolves to a watcher ID. Check you are not passing a Promise to removeWatcher.
The addWatcher function no longer returns a watcher ID, it returns a Promise which resolves to a watcher ID. Check you are not passing a Promise to removeWatcher.
We are already using proper watch ID and I can see it in logs, but it didn't help.
Can you please provide some more information, for example the device you are using, it's operating system, and the code which uses this plugin?
It doesn't stop the watcher on Android either. The only way to stop the watcher is to close the app completely.
Edit: I forgot I have a scenario where multiple watchers could be created. I resolved my issue by adding the watcher_id's to an array and was able to pull them from there and kill off the desired watcher.
@wwwizzarrdry thanks for your reply. We are using only one watcher, but the watcher times out after certain amount of time as well when the app is in background. Is it desired behavior?
I haven't had an issue on my Pixel 2 regarding the service dying in the background. Longest running process, so far, has been an 1hr:15min and everything worked fine - no disconnects in the logs.
@emil-alexandrescu Please contribute your specifics to https://github.com/capacitor-community/background-geolocation/issues/69.
Describe the bug The background watch for location is turned on OS level. It seems like running removeWatcher won't turn it off.
To Reproduce Steps to reproduce the behavior:
Expected behavior
Screenshots
Desktop (please complete the following information):
Smartphone (please complete the following information):
Additional context Add any other context about the problem here.