Search code examples
swiftbluetoothcore-locationibeaconcore-bluetooth

Can I connect to a BLE device and broadcast an iBeacon at the same time?


I am using an iPad as an iBeacon with CoreLocation. Is it possible to have the iPad connect to another BLE device (non iBeacon) using CoreBluetooth?


Solution

  • Yes. An iOS Bluetooth "Central" can connect to a Bluetooth LE Peripheral, and at the very same time act as a Bluetooth "Peripheral" and advertise an iBeacon packet. CoreBluetooth supports both modes simultaneously.

    I have built several apps that do exactly this.

    The only trick is that to advertise, the app must be in the foreground with the screen on.