chipweinberger / flutter_blue_plus

Flutter plugin for connecting and communicationg with Bluetooth Low Energy devices, on Android, iOS, macOS
Other
788 stars 478 forks source link

[Help]: onValueReceived stops receiving data if screen turned off or app moved in the background #952

Closed kaciula closed 4 months ago

kaciula commented 4 months ago

Requirements

Have you checked this problem on the example app?

Yes

FlutterBluePlus Version

1.32.7

Flutter Version

3.22.2

What OS?

Android, iOS

OS Version

Android 14, iOS 17.5.1

Bluetooth Module

-

What is your problem?

I'm syncing a sensor and I'm receiving chunks of data in onValueReceived but if I turn off the screen or move the app in the background, the rest of the data is no longer received in onValueReceived.

There are discussions about bluetooth scanning in the background but I haven't see one about how to keep the existing ble connection for a little while after the app is paused (moved in the background) If ble headsets can work while the phone's screen is off, I'm thinking that it's maybe possible to do a similar thing here and keep the ble connection open even if the app is paused.

Any thoughts on how this can be achieved?

Logs

-