Class

CLBeaconRegion

A region used to detect iBeacon hardware.

Declaration

@interface CLBeaconRegion : CLRegion

Overview

A CLBeaconRegion object defines a region that you use to detect Bluetooth beacons. Whereas a CLCircularRegion is centered on a geographic location, a CLBeaconRegion is centered on an iBeacon with specific identifying information, 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 startMonitoringForRegion: method of your location manager object. After detecting a beacon, call the startRangingBeaconsInRegion: method to determine the relative distance to that beacon.

When detecting an iBeacon, you must specify the proximityUUID, 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 proximityUUID 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 peripheralDataWithMeasuredPower: 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.

For information about how to detect beacons, see Determining the Proximity to an iBeacon.

Topics

Initializing the Beacon Region

- initWithProximityUUID:identifier:

Initializes and returns a region object that targets a beacon with the specified proximity ID.

- initWithProximityUUID:major:identifier:

Initializes and returns a region object that targets a beacon with the specified proximity ID and major value.

- initWithProximityUUID:major:minor:identifier:

Initializes and returns a region object that targets a beacon with the specified proximity ID, major value, and minor value.

Accessing the Beacon Attributes

proximityUUID

The unique ID of the beacons being targeted.

major

The value identifying a group of beacons.

minor

The value identifying a specific beacon within a group.

Delivering Beacon Notifications

notifyEntryStateOnDisplay

A Boolean value indicating whether beacon notifications are sent when the device’s display is on.

Getting Beacon Advertisement Data

- peripheralDataWithMeasuredPower:

Retrieves data that can be used to advertise the current device as a beacon.

Constants

CLBeaconMajorValue

The most significant value in a beacon.

CLBeaconMinorValue

The least significant value in a beacon.

Relationships

Inherits From

See Also

iBeacon

Determining the Proximity to an iBeacon

Learn how to detect beacons and determine the relative distance to them.

Turning an iOS Device into an iBeacon

Learn how to broadcast iBeacon signals from an iOS device.

CLBeacon

Information about a detected iBeacon and the relative distance to it.