ESTMonitoringV2Manager

@interface ESTMonitoringV2Manager : NSObject

Handles beacon enter/exit events using Estimote Monitoring v2.0 algorithm.

Estimote Monitoring uses Core Bluetooth and Core Location frameworks underneath. To make it work when the app is in background, make sure following entries are present in Info.plist file:

  • bluetooth-central, AKA Background Modes -> Uses Bluetooth LE accessories. Allows Core Bluetooth operation in background.

  • NSBluetoothPeripheralUsageDescription, description for Bluetooth alert.

  • NSLocationAlwaysUsageDescription, description for Location alert.

  • Delegate object that monitoring methods will be sent to.

    Declaration

    Objective-C

    @property (readwrite, nonatomic)
        id<ESTMonitoringV2ManagerDelegate> _Nullable delegate;

    Swift

    weak var delegate: ESTMonitoringV2ManagerDelegate? { get set }
  • Core Location region currently used by Estimote Monitoring to improve beacon monitoring reliability when the app is in Background.

    Nil before -startMonitoringForIdentifiers: is called or -stopMonitoring wasn’t called yet.

    Note: This region uses one of 20 Core Location monitoring slots available per app. For more info on global limit of Core Location regions visit: https://developer.apple.com/library/content/documentation/UserExperience/Conceptual/LocationAwarenessPG/RegionMonitoring/RegionMonitoring.html#//apple_ref/doc/uid/TP40009497-CH9-SW5

    Declaration

    Objective-C

    @property (readonly, strong, nonatomic, nullable)
        CLBeaconRegion *backgroundSupportRegion;

    Swift

    var backgroundSupportRegion: CLBeaconRegion? { get }
  • Beacon identifiers that monitoring was set up for using -startMonitoringForIdentifiers:.

    Declaration

    Objective-C

    @property (readonly, strong, nonatomic)
        NSSet<NSString *> *_Nonnull monitoredIdentifiers;

    Swift

    var monitoredIdentifiers: Set
  • Designated initializer.

    Note: Due to BLE signal unstability the actual place where notifications occur will differ. The value passed as meanTriggerDistance defines the desired mean distance from the beacon where events should happen.

    Declaration

    Objective-C

    - (nonnull instancetype)
    initWithDesiredMeanTriggerDistance:(double)meanTriggerDistance
                              delegate:(nonnull id<ESTMonitoringV2ManagerDelegate>)
                                           delegate;

    Swift

    init(desiredMeanTriggerDistance meanTriggerDistance: Double, delegate: ESTMonitoringV2ManagerDelegate)

    Parameters

    meanTriggerDistance

    Distance boundary between inside and outside states. Enter/exit events are reported when crossing these states.

    delegate

    Delegate object to invoke callbacks on.

    Return Value

    Initialized object.

  • Start monitoring beacons with given identifiers and start reporting monitoring events for these beacons to delegate.

    Overwrite the previously monitored identifiers when called multiple times.

    Note: Additionally, request Core Location always permission, send config request to Estimote Cloud, start Core Location beacon monitoring for -backgroundSupportRegion.

    Declaration

    Objective-C

    - (void)startMonitoringForIdentifiers:
        (nonnull NSArray<NSString *> *)identifiers;

    Swift

    func startMonitoring(forIdentifiers identifiers: [String])

    Parameters

    identifiers

    Identifiers of beacons to be monitored. Device identifer can be read by visiting https://cloud.estimote.com/#/

  • Stop monitoring beacons with identifiers passed to -startMonitoringForIdentififers:.

    Additionally, stop Core Location beacon monitoring for -backgroundSupportRegion.

    Declaration

    Objective-C

    - (void)stopMonitoring;

    Swift

    func stopMonitoring()