capacitor-community / background-geolocation

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

Do I have to stop watching when entering Foreground? #10

Closed c4b4d4 closed 3 years ago

c4b4d4 commented 3 years ago

Could you describe how the plugin works? I'm interested in only listening the location while being on background, does the Plugin already handles this? Does it only activate when App enters background mode, and stops when it enters foreground mode? Or do I have to detect this transitions myself and do addWatcher / removeWatcher accordingly?

diachedelic commented 3 years ago

For your use case, you will have to detect those transitions yourself. The plugin is capable of working in foreground-only by simply omitting the "backgroundMessage" option, but alas not background-only.