0

I want to detects beacon/ibeacon devices near my iphone's proximity. I am not sure which class i should use

Should i use CLBeacon and CLBeaconRegion and start monitoring region

OR

Should i use CBcentralManager and scanForPeripheralsWithServices

Which api suited best for which use case ?

I have tried to find it online but it's not documented anywhere

rmaddy
  • 314,917
  • 42
  • 532
  • 579
Mihir Mehta
  • 13,743
  • 3
  • 64
  • 88

2 Answers2

3

Although iBeacons use Bluetooth Low Energy (BLE), they are not treated as a BLE peripheral in iOS. They are handled via the CoreLocation framework, so the classes you need are CLLocationManager, CLRegion and CLBeacon. Refer to the Core Location Programming Guide

CBCentralManager is for BLE peripherals such as heart rate monitors, fitness trackers (or anything else you can think of where you want to exchange data with the peripheral)

Paulw11
  • 108,386
  • 14
  • 159
  • 186
0

CLBeacon and CLBeaconRegion are handy and able to get information in background.

CBcentralManager is not only for BLE, it can detect other legacy bluetooth device like mouse, keyboard, etc.

Satachito
  • 5,838
  • 36
  • 43