-
Notifications
You must be signed in to change notification settings - Fork 482
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Feature] Android: Background Bluetooth Support #930
Comments
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 |
as a specialization, not only in the background, in the background and switched off screen |
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 |
@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. |
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. |
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? |
A lot of time has passed and I have now solved it without scanning. We changed the hardware and now have a connection and notifications from the device. The important point to note with iOS is that you set the UIBackgroundModes correctly.
The notification from the device comes when the device sends and only when the app is hard killed will no more notifications come. |
@TheValkDokk can you share an example? |
One way to do this would be to add an option to register the target BLE device as a Companion Device.
https://developer.android.com/develop/connectivity/bluetooth/companion-device-pairing?#keep-awake I'd like to hear your thoughts on adding Companion Device functionality to FBP. |
You can't even start scanning when the screen is off - @chipweinberger It's not possible to recover from the |
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
The text was updated successfully, but these errors were encountered: