CBRegion Class Reference

Inherits from NSObject
Declared in CBRegion.h
CBRegion.m

Overview

The CBRegion class defines an abstract area that can be tracked. In iOS, you do not create instances of this class directly; instead, you instantiate subclasses that define specific types of regions.

After you create a region, you must register it with a CBBeaconManager object. The beacon manager generates appropriate events whenever the user crosses the boundaries of the region.

To use this class, create an instance of it and use the startMonitoringForRegion: method of a CBBeaconManager object to begin monitoring it.

  notifyOnEnter

App will be launched and the delegate will be notified via didEnterRegion: when the user enters the region. By default, this is YES.

@property (nonatomic, assign) BOOL notifyOnEnter

Discussion

A Boolean indicating that notifications are generated upon entry into the region.

When this property is YES, a device crossing from outside the region to inside the region triggers the delivery of a notification. If the property is NO, a notification is not generated. The default value of this property is YES.

If the app is not running when a boundary crossing occurs, the system launches the app into the background to handle it. Upon launch, your app must configure new beacon manager and delegate objects to receive the notification. The notification is sent to your delegate’s didEnterRegion: method.

Declared In

CBRegion.h

  notifyOnExit

App will be launched and the delegate will be notified via didExitRegion: when the user exits the region. By default, this is YES.

@property (nonatomic, assign) BOOL notifyOnExit

Discussion

A Boolean indicating that notifications are generated upon exit from the region.

When this property is YES, a device crossing from inside the region to outside the region triggers the delivery of a notification. If the property is NO, a notification is not generated. The default value of this property is YES.

If the app is not running when a boundary crossing occurs, the system launches the app into the background to handle it. Upon launch, your app must configure new beacon manager and delegate objects to receive the notification. The notification is sent to your delegate’s didExitRegion: method.

Declared In

CBRegion.h

  notifyEntryStateOnDisplay

App will be launched and the delegate will be notified via didDetermineState:forRegion: when the device’s screen is turned on and the user is in the region. By default, this is NO.

@property (nonatomic, assign) BOOL notifyEntryStateOnDisplay

Discussion

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

When set to YES, the beacon manager sends beacon notifications when the user turns on the display and the device is already inside the region. These notifications are sent even if your app is not running. In that situation, the system launches your app into the background so that it can handle the notifications.

In both situations, the beacon manager calls the didDetermineState:forRegion: method of its delegate object.

The default value for this property is NO.

Declared In

CBRegion.h

  identifier

The identifier for the region object. This is a value that you specify and can use to identify this region inside your application.

@property (readonly, nonatomic, copy, nonnull) NSString *identifier

Declared In

CBRegion.h

  proximityUUID

The unique ID of the beacons being targeted.

@property (readonly, nonatomic, copy, nonnull) NSUUID *proximityUUID

Declared In

CBRegion.h

  major

The value identifying a group of beacons. If you do not specify a major value for the beacon, the value in this property is nil. When this property is nil, the major value of the beacon is ignored when determining if it is a match.

@property (readonly, nonatomic, copy, nullable) NSNumber *major

Declared In

CBRegion.h

  minor

The value identifying a specific beacon within a group. If you do not specify a minor value for the beacon, the value in this property is nil. When this property is nil, the minor value of the beacon is ignored when determining if it is a match.

@property (readonly, nonatomic, copy, nullable) NSNumber *minor

Declared In

CBRegion.h

– initWithProximityUUID:identifier:

Initialize a beacon region with a proximityUUID. Major and minor values will be wildcarded.

- (nonnull instancetype)initWithProximityUUID:(nonnull NSUUID *)proximityUUID identifier:(nonnull NSString *)identifier

Parameters

proximityUUID

The unique ID of the beacons being targeted. This value must not be nil.

identifier

A unique identifier to associate with the returned region object. You use this identifier to differentiate regions within your application. This value must not be nil.

Return Value

An initialized beacon region object.

Discussion

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

This method creates a region that results in the reporting of all beacons with the specified proximityUUID value. The major and minor values of the beacons are ignored.

Declared In

CBRegion.h

– initWithProximityUUID:major:identifier:

Initialize a beacon region with an proximityUUID and major value. Minor value will be wildcarded.

- (nonnull instancetype)initWithProximityUUID:(nonnull NSUUID *)proximityUUID major:(CBMajorValue)major identifier:(nonnull NSString *)identifier

Parameters

proximityUUID

The unique ID of the beacons being targeted. This value must not be nil.

major

The major value that you use to identify one or more beacons.

identifier

A unique identifier to associate with the returned region object. You use this identifier to differentiate regions within your application. This value must not be nil.

Return Value

An initialized beacon region object.

Discussion

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

This method creates a region that reports all beacons with the specified proximityUUID and major values. The beacon’s minor value is ignored.

Declared In

CBRegion.h

– initWithProximityUUID:major:minor:identifier:

Initialize a beacon region identified by an proximityUUID, major and minor values.

- (nonnull instancetype)initWithProximityUUID:(nonnull NSUUID *)proximityUUID major:(CBMajorValue)major minor:(CBMinorValue)minor identifier:(nonnull NSString *)identifier

Parameters

proximityUUID

The unique ID of the beacons being targeted. This value must not be nil.

major

The major value that you use to identify one or more beacons.

minor

The minor value that you use to identify a specific beacon.

identifier

A unique identifier to associate with the returned region object. You use this identifier to differentiate regions within your application. This value must not be nil.

Return Value

An initialized beacon region object.

Discussion

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

This method creates a region that reports the beacon with the specified proximityUUID, major, and minor values.

Declared In

CBRegion.h

– dictionary

Represent all value of this object in a NSDictionary.

- (nonnull NSDictionary *)dictionary

Return Value

All values of this object in dictionary format.

Declared In

CBRegion.h