A region used to detect the presence of iBeacon devices.
SDKs
- iOS 7.0+
- Mac Catalyst 13.0+
Framework
- Core Location
Declaration
@interface CLBeaconRegion : CLRegion
Overview
A CLBeacon
object defines a region that you use to detect Bluetooth beacons conforming to the iBeacon specification. Whereas a CLCircular
is centered on a geographic location, a CLBeacon
is focused on an iBeacon with specific identifying characteristics, which you provide. When a matching device comes in range, Core Location notifies your app.
You monitor beacon regions in two ways. To detect when a beacon is in range, use the start
method of your location manager object. After detecting a beacon, call the start
method to determine the relative distance to that beacon.
When detecting an iBeacon, you must specify the proximity
, major
, and minor
values that you programmed into the beacon hardware. You use the values to identify your beacons uniquely and you can specify a subset of values to detect multiple beacons. The proximity
property is typically the same for all of the beacons in your installation. Use the major
and minor
values to distinguish among different beacons in your installation.
If you want to configure the current iOS device as a Bluetooth beacon, create a beacon region with the appropriate identifying information. You can then call the peripheral
method of the region to get a dictionary that you can use to advertise the device with the Core Bluetooth framework. For more information about using that framework to advertise the device as a beacon, see Turning an iOS Device into an iBeacon Device.
For information about how to detect beacons, see Determining the Proximity to an iBeacon Device.