BLE device which was connected using flutter_reactive_ble library disconnect automatically when the app restored from background, such as lock screen and restore or move to other app and return.
So, I checked my code and noticed that when the app restored, my background service will be stopped.
There is no problem in iOS, only in android.
With this code, when the app restored from background, first service.stopSelf() function is called. And then print("BLE Disconnect is disconnected"); function is called.
BLE device which was connected using flutter_reactive_ble library disconnect automatically when the app restored from background, such as lock screen and restore or move to other app and return. So, I checked my code and noticed that when the app restored, my background service will be stopped. There is no problem in iOS, only in android.
This is my bluetooth connect code.
This is my background service code.
With this code, when the app restored from background, first service.stopSelf() function is called. And then print("BLE Disconnect is disconnected"); function is called.
Please give me a solution. Thank you.