-
Notifications
You must be signed in to change notification settings - Fork 103
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Can't disconnect BLE devices when killing the app with background plugin on #136
Comments
After some testings, it appears that it is an issue caused by the Foregroundservice which doesn't close when I close the app. I tried to add the stopWithTask = "true" in the Android Manifest in the service field (both for the background service and for the beacon/bluetooth service, terminating one of them would cause the disconnection of the ble devices from the phone), but this doesn't force the service to stop when I swipe away the app! How can this happen? Do you have any suggestion about that, or things I must be aware of when trying to close a service together with the app? Any idea why it behaves like this? How can I force the service created by this plugin to stop? Can it be that the some service is not "binded" to the app, and therefore it doesn't see the stopWithTask when I close the app? |
Have you find any solution? I am facing same issue. It also happens when I force stop iOS application. |
@pooja-shah unfortunately I haven't found any good and definitive solution. |
I'm facing an issue not directly related (I guess) to this plugin, but since I suspect it is a conflict or a strange behaviour in the bluetooth connection, I guess if someone who better knows how to manage BLE devices can help me understand how to solve this issue.
I'm developing an app that interfaces with BLE devices.
Inside the app I can pair the devices and monitor their status.
If I close the app I want to disconnect the devices from the smartphone, and when I open it again, I want the app to reconnect automatically to known devices.
Everything works fine without using the background plugin, but I need to use it since the app needs to monitor the BLE devices even when it's in background.
The problem happens ONLY if I use the background plugin: if I open again the app, the known devices are not reconnected INSIDE the app, but it appears they are already/still connected to the smartphone from the previous time (even if not shown in the bluetooth devices in the phone settings).
It seems that the bluetooth connection to known devices isn't really being closed when I kill the app.
It appears like the device is still connected as therefore it doesn't show up when I scan in the app.
I can't reconnect until I close the app, switch off and then on again bluetooth, and reopen the app.
The steps are very simples:
Why this behaviour? Looks like something in the background plugin prevents the bluetooth connection to be closed on app closing. I specify that:
Thanks
The text was updated successfully, but these errors were encountered: