ScanDevices does not detect other phones
Closed this issue · 2 comments
Hi,
I want to scan from an IPhone 12 for other bluetooth devices that have bluetooth enabled, like 2 Android phones for example.
I use this code for Ionic:
import:
import { BleClient } from '@capacitor-community/bluetooth-le';
code:
BleClient.requestLEScan({allowDuplicates: true}, (device) => {
if (device.localName) {
this.devicesList.push(device);
this.cdr.detectChanges();
}
}).then(() => {
this.scanning = true;
});
When I run the app with:
on android ionic cap run android -l --external --open
on ios ionic cap run ios -l --external --open
the ionic app installed on ios does not detect the android devices, it detects only my apple watch, or xiaomi toothbrush.
also if I install on android the ionic app, does not want to detect ios phone, and the other android phone, and neither xiaomi toothbrush.
How can I detect phones that have bluetooth enabled and have discoverability on?
When I go to ios settings bluetooh, I can see the two Android phones, but on my Ionic app, I cannot see them when running BleClient.requestLEScan.
Please help!
This plugin can only be used to interact with Bluetooth Low Energy peripherals (not Bluetooth classic). Another phone can be a Bluetooth Low Energy peripheral, but this is not on by default. A phone is usually the central device (not peripheral). So you need an app running on the other phone that advertises, just turning Bluetooth on might not be enough.
Thanks