Inherits from NSObject
Declared in RECOBeaconManager.h

Overview

The RECOBeaconManager class defines the interfae for configuring the delivery of RECOBeaconRegion-related events to your application. You use an instance of this cass to establish the parameters that determine when RECOBeaconRegion events should be delivered and to start and stop the actual delivery of thise events.

A RECOBeaconManager object provides support for the following RECOBeaconRegion-related activities:

  • Monitoring distinct regions of interest and generating location events when the user enters or leaves those regions.
  • Reporting the range to nearby beacons.

A RECOBeaconManager object contains an instance of CLLocationManager. For more details about CLLocationManager, please refer to here

Properties

delegate

The delegate object to receive update events.

@property (nonatomic, assign) id<RECOBeaconManagerDelegate> delegate

Discussion

The delegate object to receive update events.

Declared In

RECOBeaconManager.h

Class Methods

isMonitoringAvailable

Returns a Boolean indicating whether the device supports region monitoring using the specified class.

+ (BOOL)isMonitoringAvailable

Return Value

YES if the device is capable of monitoring regions using the specified class or NO if it is not.

Discussion

Returns a Boolean indicating whether the device supports region monitoring using the specified class.

The availability of region monitoring support is dependent on the hardware present on the device. This method does not take into account the availability of location services or the fact that the user might have disabled them for the app or system; you must determine your app’s authorization status separately. You can find out the location service availability by calling locationServiceEnabled of the RECOBeaconManager class.

Declared In

RECOBeaconManager.h

isRangingAvailable

Returns a Boolean indicating whether the device supports ranging of Bluetooth beacons.

+ (BOOL)isRangingAvailable

Return Value

YES if the device supports ranging or NO if it does not.

Discussion

Returns a Boolean indicating whether the device supports ranging of Bluetooth beacons.

Declared In

RECOBeaconManager.h

locationServicesEnabled

Returns a Boolean value indicating whether location services are enabled on the device.

+ (BOOL)locationServicesEnabled

Return Value

YES if location services are enabled; NO if they are not.

Discussion

Returns a Boolean value indicating whether location services are enabled on the device.

The user can enable or disable location services from the Settings application by toggling the Location Services switch in General.

You should check the return value of this method before starting location updates to determine whether the user has location services enabled for the current device. Location services prompts users the first time they attempt to use location-related information in an app but does not prompt for subsequent attempts. If the user denies the use of location services and you attempt to start location updates anyway, the RECOBeaconManager reports an error to its delegate.

Declared In

RECOBeaconManager.h

Instance Methods

getMonitoredRegions

The set of shared regions monitored by all RECOBeaconManager objects. (read-only)

You cannot add regions to this property directly. Instead, you must register regions by calling the startMonitoringForRegion: method. The regions in this property are shared by all instances of the RECOBeaconManager class in your application.

- (NSSet *)getMonitoredRegions

Return Value

The set of shared regions monitored by all RECOBeaconManager objects. (read-only)

Discussion

The set of shared regions monitored by all RECOBeaconManager objects. (read-only)

You cannot add regions to this property directly. Instead, you must register regions by calling the startMonitoringForRegion: method. The regions in this property are shared by all instances of the RECOBeaconManager class in your application.

The objects in this set may not necessarily be the same objects you specified at registration time. Only the region data itself is maintained by the system. Therefore, the only way to uniquely identify a registered region is using its identifier property.

The RECOBeaconManager persists region data between launches of your application. If your application is terminated and then relaunched, the contents of this property are repopulated with region objects that contain the previously registered data.

Declared In

RECOBeaconManager.h

getRangedRegions

The set of regions currently being tracked using ranging. (read-only)

- (NSSet *)getRangedRegions

Return Value

The set of regions currently being tracked using ranging. (read-only)

Discussion

The set of regions currently being tracked using ranging. (read-only)

The objects in the set are instances of the RECOBeaconRegion class.

Declared In

RECOBeaconManager.h

requestStateForRegion:

Retrieves the state of a region asynchronously.

- (void)requestStateForRegion:(RECOBeaconRegion *)recoRegion

Parameters

recoRegion

The region whose state you want to know.

Discussion

Retrieves the state of a region asynchronously.

This method performs the request asynchronously and delivers the results to the RECOBeaconManager’s delegate. You must implement the locationManager:didDetermineState:forRegion: method in the delegate to receive the results.

If the region parameter contains an unknown type of region object, this method does nothing.

Declared In

RECOBeaconManager.h

startMonitoringForRegion:

Starts monitoring the specified region.

- (void)startMonitoringForRegion:(RECOBeaconRegion *)recoRegion

Parameters

recoRegion

The region object that defines the boundary to monitor. This parameter must not be nil.

Discussion

Starts monitoring the specified region.

You must call this method once for each region you want to monitor. If an existing region with the same identifier is already being monitored by the application, the old region is replaced by the new one. The regions you add using this method are shared by all RECOBeaconManager objects in your application and stored in the NSSet object which can be available through getMonitoredRegions: method.

Region events are delivered to the recoManager:didEnterRegion and recoManager:didExitRegion: methods of your delegate. If there is an error, the RECOBeaconManager calls the recoManager:monitoringDidFailForRegion:withError: method of your delegate instead.

An app can register up to 20 regions at a time. In order to report region changes in a timely manner, the region monitoring service requires network connectivity.

An app can expect to receive the appropriate region entered or region exited notification within 3 to 5 minutes on average, if not sooner.

Declared In

RECOBeaconManager.h

startRangingBeaconsInRegion:

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

- (void)startRangingBeaconsInRegion:(RECOBeaconRegion *)recoRegion

Parameters

recoRegion

The region object that defines the identifying information for the targeted beacons. The number of beacons represented by this region object depends on which identifier values you use to initialize it. Beacons must match all of the identifiers you specify. This method copies the region information it needs from the object you provide.

Discussion

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

Once registered, the RECOBeaconManager reports any encountered beacons to its delegate by calling the recoManager:didRangeBeacons:inRegion: method. If there is an error registering the specified beacon region, the RECOBeaconManager calls its delegate’s recoManager:rangingBeaconsDidFailForRegion:withError: method and provides the appropriate error information.

Declared In

RECOBeaconManager.h

stopMonitoringForRegion:

Stops monitoring the specified region.

- (void)stopMonitoringForRegion:(RECOBeaconRegion *)recoRegion

Parameters

recoRegion

The region object currently being monitored. This parameter must not be nil.

Discussion

Stops monitoring the specified region.

Declared In

RECOBeaconManager.h

stopRangingBeaconsInRegion:

Stops the delivery of notifications for the specified beacon region.

- (void)stopRangingBeaconsInRegion:(RECOBeaconRegion *)recoRegion

Parameters

recoRegion

The region that identifies the beacons. The object you specify need not be the exact same object that you registered but the beacon attributes should be the same.

Discussion

Stops the delivery of notifications for the specified beacon region.

Declared In

RECOBeaconManager.h