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

Combination with BLE Plugin: No disconnect when app gets closed #32

Closed pentabarf closed 2 years ago

pentabarf commented 2 years ago

Description Using this Plugin together with cordova-plugin-ble-central or capacitor-community/bluetooth-le in Android bluetooth connection doesn't get closed when app is closed.

Reproduce

  1. Create an ionic app for Android
  2. install background-geolocation
  3. install cordova-plugin-ble-central or capacitor-community/bluetooth-le
  4. connect a ble device with the app
  5. close the app
  6. device is still connected with phone and therefore doesn't get find when reopen the app
  7. to verify: disable Bluetooth in phone settings after app is closed and the device will notify a disconnect

Expected behavior Bluetooth connection should get closed when app gets closed

Smartphone

Additional context I am working on a ble-sensor combined with geolocation tracker project

I opened this also as an issue at capacitor-community/bluetooth-le: https://github.com/capacitor-community/bluetooth-le/issues/158

diachedelic commented 2 years ago

If you discover a fault in this plugin, please let me know.

pentabarf commented 2 years ago

Does the Watcher gets removed when closing the app? Or is there any option to do so?

diachedelic commented 2 years ago

If by "closing" you mean "killing", then yes. If by "closing" you mean "backgrounding", then no. If you only require updates in the foreground, simply omit the backgroundMessage option.

pentabarf commented 2 years ago

yes i mean "killing"