don/cordova-plugin-ble-central

Some BLE not found

valeprog opened this issue · 5 comments

I have been using the plugin for some years without problems, now since I updated to the latest version with the scan I no longer see some BLEs, while if I reinstall my previous app I find them correctly

UPGRADE if I install new app on a smartphone with old Android system, all Beacon are found...

Hi @valeprog

Android 12+ scans will filter out beacons with the plugins default settings sure to the use of the neverForLocation flag: https://developer.android.com/guide/topics/connectivity/bluetooth/permissions#assert-never-for-location

When targeting android 12+, you'll need to use the slim variant of the plugin (instructions) and remove the android:usesPermissionFlags="neverForLocation" bit from the example manifest. Then you'll need to request ACCESS_FINE_LOCATION on Android 12 at runtime. I usually use the cordova.plugin.diagnostics for this.

Unfortunately, there's no way for me to wrap the above up in the plugin, but I might put together some better documentation about how to do this with an example.

Hi @peitschie
Ok thanks I'll try.

ok without android:usesPermissionFlags="neverForLocation" it work fine.

Fantastic. Glad you were able to sort things out @valeprog