blessed-android-coroutines icon indicating copy to clipboard operation
blessed-android-coroutines copied to clipboard

How to auto connect BLE device when in range in background?

Open mmswide opened this issue 2 years ago • 3 comments

Is there a way to auto connect BLE device in background when the app is in the background?

mmswide avatar Sep 28 '22 22:09 mmswide

The method autoConnectPeripheral() will work as long as the app is running. If your app gets killed often you need to use a ForegroundService....

weliem avatar Sep 29 '22 05:09 weliem

Thank you. I will try.

mmswide avatar Sep 29 '22 06:09 mmswide

I created foreground service and startScan in background task. But I could get any response from BluetoothCentralManagerCallback. Would you please help me how I can get this callback from startScan in background?

mmswide avatar Oct 03 '22 17:10 mmswide

I think your question is going beyond the scope of this library, so I am closing the issue

weliem avatar Oct 26 '22 16:10 weliem