I am hoping I can make an iOS app run a self-test to see if it's able to listen to beacons, by:
CBPeripheralManager
API, andIn other words, make the device listen for the beacon that it, its very self, is advertising.
I do get a success response when I start advertising: the system calls my peripheralManagerDidUpdateState
handler with peripheral.state
set to PoweredOn
.
I also get a success response when I start monitoring for beacons: the system calls my locationManager:didStartMonitoringForRegion:
handler. I also get locationManager:didRangeBeacons:inRegion:
calls.
However, it always gives me a zero-length list of beacons in range.
Does anyone know: does iOS prevent a device from monitoring or ranging itself as a beacon?
Unfortunately, no. Neither CoreLocation
nor CoreBluetooth
will pick up an advertisement transmitted by the same device. This should not really be surprising as the device has a single Bluetooth radio, so it cannot transmit and receive at the same time.