capacitor-community / background-geolocation

A Capacitor plugin that sends you geolocation updates, even while the app is in the background.
MIT License
180 stars 56 forks source link

[Question] Is the notification on android always shown, or only while the task is run? #25

Closed jesperbjerke closed 3 years ago

jesperbjerke commented 3 years ago

I don't need very accurate location, and only need to update it like once in a while from the background. What I can't figure out is if the notification for android is only shown the short duration while the location is updated, or all the time as long as the service is active?

diachedelic commented 3 years ago

The notification is shown if at least one watcher exists, and the app is not in the foreground. Showing the notification makes it possible to receive foreground location updates even while the app is in the background. Confusing, this is not the same as "real" background location updates on Android, which are only provided a few times an hour. You may want to look into that, see https://developer.android.com/training/location/background.

jesperbjerke commented 3 years ago

Okay, thanks for the info! Any plans on implementing an option for only listening on that kind of background location for this plugin?

diachedelic commented 3 years ago

If it was possible to implement consistently across Android and iOS, I would consider it. I do not have the time to implement such a feature myself, however.

diachedelic commented 3 years ago

See #19.