EPXProximityObserver


@interface EPXProximityObserver : NSObject

Observes and reports proximity of Estimote devices. Uses Estimote Monitoring under the hood. Encapsulates it under tag-based beacon identification and callback blocks.

  • Unavailable

    Init is disabled for this class.

    Declaration

    Objective-C

    - (nonnull instancetype)init;
  • Unavailable

    New is disabled for this class.

    Declaration

    Objective-C

    + (nonnull instancetype)new;
  • Convenience initializer. Calls designated initializer with default configuration.

    Declaration

    Objective-C

    - (nonnull instancetype)
        initWithCredentials:(nonnull EPXCloudCredentials *)credentials
                    onError:(nonnull void (^)(NSError *_Nonnull))errorBlock;

    Swift

    init(credentials: EPXCloudCredentials, onError errorBlock: @escaping (Error) -> Void)

    Parameters

    credentials

    Cloud Credentials object used to authorize requests sent to Estimote Cloud.

    errorBlock

    Block invoked whenever error occurs. The parameter is an NSError object, with domain equal to EPXProximityObserverErrorDomain and code from EPXProximityObserverError enum.

  • Designated initializer.

    Declaration

    Objective-C

    - (nonnull instancetype)
        initWithCredentials:(nonnull EPXCloudCredentials *)credentials
              configuration:
                  (nonnull EPXProximityObserverConfiguration *)configuration
                    onError:(nonnull void (^)(NSError *_Nonnull))errorBlock;

    Swift

    init(credentials: EPXCloudCredentials, configuration: EPXProximityObserverConfiguration, onError errorBlock: @escaping (Error) -> Void)

    Parameters

    credentials

    Cloud Credentials object used to authorize requests sent to Estimote Cloud.

    configuration

    Proximity observer configuration that can be used for Proximity Observer’s behaviour customization.

    errorBlock

    Block invoked whenever error occurs. The parameter is an NSError object, with domain equal to EPXProximityObserverErrorDomain and code from EPXProximityObserverError enum.

  • Start observing and calling callbacks on provided proximity zones:

    • request device details for all user’s devices from Estimote Cloud,
    • start Estimote Monitoring at registered ranges,
    • call registered enter/exit/change blocks when proximity event occurs.

    Subsequent calls of this method cause overwriting previously observed zones.

    Declaration

    Objective-C

    - (void)startObservingZones:(nonnull NSArray<EPXProximityZone *> *)zones;

    Swift

    func startObserving(_ zones: [EPXProximityZone])

    Parameters

    zones

    Zones to be observed.

  • Stop observing and calling callbacks for all zones that were provided with -startObservingZones:, release memory resources allocated for monitoring the zones.

    Subsequent calls of this method (without re-starting observing zones) have the same effect as calling it just once.

    Declaration

    Objective-C

    - (void)stopObservingZones;

    Swift

    func stopObservingZones()