BLUBeaconManager Class Reference

Inherits from NSObject
Declared in BLUBeaconManager.h

Overview

BLUBeaconManager objects are used to manage the discovery of beacons.

The beacon manager is responsible for discovering beacons though CoreBluetooth, as well as providing a light wrapper around CoreLocation. If your application requires the use of iBeacons and monitoring iBeacon regions please see Apple’s Core Location documentation.

Delegate properties

  delegate

The delegate object you want to receive BLUBeaconManager events.

@property (nonatomic, nullable, weak) id<BLUBeaconManagerDelegate> delegate

Discussion

The delegate object you want to receive BLUBeaconManager events.

Declared In

BLUBeaconManager.h

  delegateQueue

The NSOperationQueue for all delegates and callbacks to be dispatched to.

@property (nonatomic, readonly) NSOperationQueue *delegateQueue

Discussion

The NSOperationQueue for all delegates and callbacks to be dispatched to.

Declared In

BLUBeaconManager.h

CoreBluetooth properties

  centralManagerState

The state of the beacon manager’s CoreBluetooth Central Manager.

@property (nonatomic, readonly) CBManagerState centralManagerState

Discussion

The state of the beacon manager’s CoreBluetooth Central Manager.

Declared In

BLUBeaconManager.h

CoreLocation region properties

  monitoredRegions

The set of regions monitored by the beacon manager.

@property (nonatomic, readonly) NSSet<CLBeaconRegion*> *monitoredRegions

Discussion

The set of regions monitored by the beacon manager.

Declared In

BLUBeaconManager.h

  rangedRegions

The set of regions ranged by the beacon manager.

@property (nonatomic, readonly) NSSet<CLBeaconRegion*> *rangedRegions

Discussion

The set of regions ranged by the beacon manager.

Declared In

BLUBeaconManager.h

Beacon properties

  foundBeacons

The set of found beacons that match any applied filters.

@property (nonatomic, readonly) NSSet<__kindofBLUBeacon*> *foundBeacons

Discussion

The set of found beacons that match any applied filters.

Declared In

BLUBeaconManager.h

  allBeacons

The set of all beacons.

@property (nonatomic, readonly) NSSet<__kindofBLUBeacon*> *allBeacons

Discussion

The set of all beacons.

Declared In

BLUBeaconManager.h

Filter properties

  appliedFilters

The set of applied filters to the beacon manager.

@property (nonatomic, readonly) NSSet<BLUBeaconFilter*> *appliedFilters

Discussion

The set of applied filters to the beacon manager.

Declared In

BLUBeaconManager.h

  scanning

Weather or not the beacon manager is currently scanning

@property (nonatomic, readonly, getter=isScanning) BOOL scanning

Discussion

Weather or not the beacon manager is currently scanning

Declared In

BLUBeaconManager.h

Initialization

– initWithDelegate:

Initializes an instance of beacon manager with the specified delegate object.

- (instancetype)initWithDelegate:(nullable id<BLUBeaconManagerDelegate>)delegate

Parameters

delegate

The delegate to receive beacon manager events.

Return Value

Returns a newly initialized beacon manager.

Discussion

Initializes an instance of beacon manager with the specified delegate object.

Declared In

BLUBeaconManager.h

– initWithDelegate:delegateQueue:options:

Initializes an instance of beacon manager with the specified delegate object and delegate queue.

- (instancetype)initWithDelegate:(nullable id<BLUBeaconManagerDelegate>)delegate delegateQueue:(nullable NSOperationQueue *)delegateQueue options:(nullable NSDictionary *)options

Parameters

delegate

The delegate to receive beacon manager events.

delegateQueue

The queue to dispatch all delegate events on. If the value is nil, the beacon manager dispatches events using the main queue.

options

An optional dictionary containing initialization options for the beacon manager’s instance of CBCentralManager.

Return Value

Returns a newly initialized beacon manager instance.

Discussion

Initializes an instance of beacon manager with the specified delegate object and delegate queue.

Declared In

BLUBeaconManager.h

CoreLocation based scanning

– startMonitoringForRegion:

Starts monitoring the specified region.

- (void)startMonitoringForRegion:(CLBeaconRegion *)region

Parameters

region

The region object that defines the boundary to monitor.

Discussion

Starts monitoring the specified region.

Declared In

BLUBeaconManager.h

– stopMonitoringForRegion:

Stops monitoring the specified region.

- (void)stopMonitoringForRegion:(CLBeaconRegion *)region

Parameters

region

The region object currently being monitored.

Discussion

Stops monitoring the specified region.

Declared In

BLUBeaconManager.h

– startRangingBeaconsInRegion:

Starts the delivery of notifications for beacons in the specified beacon region.

- (void)startRangingBeaconsInRegion:(CLBeaconRegion *)region

Parameters

region

The region object that defines the identifying information for the targeted beacons.

Discussion

Starts the delivery of notifications for beacons in the specified beacon region.

Declared In

BLUBeaconManager.h

– stopRangingBeaconsInRegion:

Stops the delivery of notifications for the specified beacon region.

- (void)stopRangingBeaconsInRegion:(CLBeaconRegion *)region

Parameters

region

The region that identifies the beacons.

Discussion

Stops the delivery of notifications for the specified beacon region.

Declared In

BLUBeaconManager.h

– requestStateForRegion:

Retrieves the state of a region.

- (void)requestStateForRegion:(CLBeaconRegion *)region

Parameters

region

The region whose state you want to know.

Discussion

Retrieves the state of a region.

Declared In

BLUBeaconManager.h

CoreLocation Authorization

+ authorizationStatus

Returns the app’s authorization status for using location services.

+ (CLAuthorizationStatus)authorizationStatus

Return Value

A value indicating whether the app is authorized to use location services.

Discussion

Returns the app’s authorization status for using location services.

Declared In

BLUBeaconManager.h

– requestWhenInUseAuthorization

Requests permission to use location services while the app is in the foreground.

- (void)requestWhenInUseAuthorization

Discussion

Requests permission to use location services while the app is in the foreground.

Declared In

BLUBeaconManager.h

– requestAlwaysAuthorization

Requests permission to use location services whenever the app is running.

- (void)requestAlwaysAuthorization

Discussion

Requests permission to use location services whenever the app is running.

Declared In

BLUBeaconManager.h

Bluetooth based scaning

– startScanningForBeacons

Begins scanning for beacons via bluetooth.

- (void)startScanningForBeacons

Discussion

Begins scanning for beacons via bluetooth.

When a beacon is first discovered the beaconManager:didFindBeacon: method will be invoked. Whenever that beacon’s ranging information changes beaconManager:beacon:didChangeDistance: will be called. After the beacon has not been seen for some time beaconManager:didLoseBeacon: will be invoked notifying you that the beacon cannot be seen.

Declared In

BLUBeaconManager.h

– startScanningForBeaconsWithInterval:

Begins scanning for beacon via bluetooth with the specified time interval. Scanning will stop once this interval has been reached.

- (void)startScanningForBeaconsWithInterval:(NSTimeInterval)interval

Parameters

interval

The time interval which scanning will happen for.

Discussion

Begins scanning for beacon via bluetooth with the specified time interval. Scanning will stop once this interval has been reached.

Declared In

BLUBeaconManager.h

– stopScanning

Stops the scanning for bluetooth beacons.

- (void)stopScanning

Discussion

Stops the scanning for bluetooth beacons.

Declared In

BLUBeaconManager.h

Filtering

– addFilter:

Adds a filter to the scanning of beacon. If a beacon does not match any applied filters, then you will not be notified of any beacon related discovery delegate methods

- (void)addFilter:(BLUBeaconFilter *)filter

Parameters

filter

The filter to add

Discussion

Adds a filter to the scanning of beacon. If a beacon does not match any applied filters, then you will not be notified of any beacon related discovery delegate methods

Declared In

BLUBeaconManager.h

– removeFilter:

Removes a filter that has been previously applied.

- (void)removeFilter:(BLUBeaconFilter *)filter

Parameters

filter

The filter to remove

Discussion

Removes a filter that has been previously applied.

Declared In

BLUBeaconManager.h

– removeAllFilters

Removes all applied filters.

- (void)removeAllFilters

Discussion

Removes all applied filters.

Declared In

BLUBeaconManager.h

Associating beacons

– associatedBeaconsForBeacon:

A single beacon object might be associated with multiple other beacon objects. For example. A Bluvision beacon might be set up to broadcast sBeacon and EddystoneBeacons at the same time. Using this method you can find out all the different beacon objects associated with a specified beacon.

- (nullable NSArray<__kindofBLUBeacon*> *)associatedBeaconsForBeacon:(BLUBeacon *)beacon

Parameters

beacon

The beacon object to get associated beacons for

Return Value

An array of beacons associated with the specified beacon.

Discussion

A single beacon object might be associated with multiple other beacon objects. For example. A Bluvision beacon might be set up to broadcast sBeacon and EddystoneBeacons at the same time. Using this method you can find out all the different beacon objects associated with a specified beacon.

Declared In

BLUBeaconManager.h