-
Notifications
You must be signed in to change notification settings - Fork 326
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
5.0.3 version does not can't scan BLE Beacons devices on Android 12+ #664
Comments
It works in my Android 12, not using code from example folder though. |
I have observed the following, running flutter_reactive_ble:
I've also seen the same behaviour with other beacon-sensing packages for flutter, such as flutter_beacon and beacon_broadcast. Is there a possibility this is a permission-realted issue? |
Based on this Stackoverflow it seems that the underlaying Android library RxAndroidBle which flutter_reactive_ble uses defines the scanForDevices without on empty ScanFilter: see here line 70. |
Thanks for the thoughts and references Julian. I'm not using any ScanFilter currently, but still only seeing iBeacons on my Android 11 phone. Are you suggesting that we need to add something iBeacon-specific into the withServices field?
|
I am not suggesting anything 😅. As we have only tested on Android 13 so far, it seems that the flutter_reactive_ble, by only beeing registered as a plugin (without being called!) swallows all the iBeacons from the Android system. If you have any idea, we would be happy to resolve this problem, too 😄 I don't think the withServices needs any classifier, but based on the stack answer it seems that by only accepting the list and calling the |
Thanks again Julian - I'm looking forward to testing. It sounds like "flutter_reactive_ble breaking iBeacons for everything" might deserve its own issue thread? I'm curious what could have changed from Android 11 to cause an issue like this. |
We just fixed our "problem" by using the solution from this #566 (comment). 🎉 Please tell me if that also resolved your problem. |
Thanks again for the advice, much appreciated. Unfortunately the only thing that has worked for me is to completely remove reactive_ble. Now other ble packages can sense iBeacons again, so i'm up and running. Damn! |
It did not help me. I still can't detect iBeacons on Android 12 |
Which package you've chosen? |
I'm using flutter_beacon - As of today we have broadcasting and sensing working on Android 11 and 13, as well as iOS. Hope that helps! Top tip that might help you: iOS handles bluetooth permission weirdly, so you don't want to explicitly request it, just go ahead and try to use bluetooth and it will automatically request permission. For Android you should request first, then use |
Thanks for reply. |
So with iBeacons you have to know the UUID you are looking for before you scan, you can't just scan for anything that's around. Here's a snipet from our project:
For AltBeacon you can do all sorts of things, but iOS won't be able to transmit anything other than iBeacon. Hope that helps! |
Thank you for your link. The problem is actually solved by making the specified changes to the file AndroidManifest.xml, and I used the string 'tools:targetApi="s"'. It is important to note that to start scanning, you need to request the necessary permissions directly in the application. In my case, I requested the following permissions: locationWhenInUse, bluetoothScan, bluetoothConnect. For this, I used the 'permission_handler' package from pub.dev. |
When use a flutter_reactive_ble scanner does not see any Beacon devices on Android 12+
I tried to scan for devices - scanner does not detect any BLE Beacons devices on Android 12+, while it perfectly detects all of BLE Beacon devices on Android 11 and lower.
To Reproduce
Steps to reproduce the behavior:
flutter pub get
andflutter packages pub run build_runner build --delete-conflicting-outputs
in folders:example
,packages/flutter_reactive_ble
,packages/reactive_ble_mobile
,packages/reactive_ble_platform_interface
.Expected behavior
While scanning all BLE Beacons devices must be detected
Smartphone
Peripheral device
Additional context
To start an app from example I had to fix some bugs
import 'dart:typed_data';
to files:
The text was updated successfully, but these errors were encountered: