Open albrownwood opened 4 years ago
Hi!
It seems the native client has been destroyed. Are you by any chance calling bleManager.destroyClient()
somewhere?
Hello, yes indeed, in the stopScan function I am calling
await _bleManager.stopPeripheralScan();
await _bleManager.destroyClient();
which I thought would be fine since I call the following in startScan:
_bleManager = BleManager();
await _bleManager.createClient();
_bleManager.startPeripheralScan(...);
I think it might be related to https://github.com/Polidea/FlutterBleLib/issues/503 We've recently introduced additional call to stopScan when unsubsribing from peripheral scan, which is probably called after going to background (and destroying the client beforehand). If that's the case, possible workarounds for now would be:
Meanwhile I'll try to figure out how to fix it.
Thanks, I took the temporary workaround of not destroying the client when app goes background for now. Keeping this open.
@mikolak Thanks for your excellent package. Have you have a time plan for this issue, I just checked in Project this is not in TO DO column
Hi! I'm afraid I don't have the time lately and I'm unable to tell for how long will this situation go on.
Any update on this?
+1 and following
I am trying to stop the ble scanning when the app goes to background using WidgetsBindingObserver to obtain the app lifecycle events
when the app goes to background, the scan stops (and correctly resumes when app comes foreground) but I get the following error message:
Am I using the right approach here ?