chipweinberger / flutter_blue_plus

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

[Feature] Android: Background Bluetooth Support #930

Open chipweinberger opened 2 months ago

chipweinberger commented 2 months ago

FlutterBluePlus Version

1.32.8

Flutter Version

3.22

What OS?

Android

OS Version

all

Bluetooth Module

all

What is your feature request?

support BLE when app is in the background

Logs

none
TheValkDokk commented 2 months ago

don't know if this helps but i just having this issue on SM-991N, the scan results doesn't return anything, but on xiaomi 12T, it's fine, i can stream data from the flutter_foreground_task to the main ui thread

explodus commented 1 month ago

as a specialization, not only in the background, in the background and switched off screen

TheValkDokk commented 1 month ago

This is how i do it:

My project is private so i can't provide code but i will make an example if i have time

ConnorDykes commented 2 weeks ago

@TheValkDokk I am working on a project that desperately needs this, Can I reach out to buy directly for a quick conversation on the topic. I could pay you for your time if need be. My company attempted to contract the owner of this package for support on this but he could not deliver on the contract. You might be a better resource.

GreedyGrinner commented 2 weeks ago

On android scanning only works in doze mode if the service is scanning for a specific mac-address or ServiceUUID, otherwise it returns empty. On iOS you need to scan for specific ServiceUUIDs as well. In terms of scanning for all advertising devices i have no found a solution.

fpozatto commented 1 week ago

as a specialization, not only in the background, in the background and switched off screen

You mentioned in the other post that you added a lot of debug information to find where the lib was stopping. Any further luck with that? Were you able to override something?