You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
There is any option to set an empty list of service UUID or filter for manufacturer data? I want decode a iBeacon frame when i turn off the screen but Android doesn't allow.
The text was updated successfully, but these errors were encountered:
Hello! For iBeacon scanning specifically, this plugin probably won't be the best fit as it can't scan by manufacturer data (iOS has no equivalent interface that I'm aware of).
You can attempt to scan with an empty service UUID list, but many Android manufacturers will block background scanning like this.
It might help someone, I was able to make the app work in the background by adding a filter (for iBeacon) in the file node_modules > cordova-plugin-ble-central > src > android > BLECentralPlugin.java
and inserted these instructions at about line 980:
discoverCallback = callbackContext;
bluetoothLeScanner = bluetoothAdapter.getBluetoothLeScanner();
List<ScanFilter> filters = new ArrayList<ScanFilter>();
ScanFilter.Builder builder = new ScanFilter.Builder();
builder.setManufacturerData(0x004c, new byte[] {});
ScanFilter filter = builder.build();
filters.add(filter);
bluetoothLeScanner.startScan(filters, scanSettings, leScanCallback);
peitschie
changed the title
startScan() without filters doesn't allow me to scan in background
startScan() doesn't support filtering by manufacturer data
Jul 19, 2022
There is any option to set an empty list of service UUID or filter for manufacturer data? I want decode a iBeacon frame when i turn off the screen but Android doesn't allow.
The text was updated successfully, but these errors were encountered: