BeaconsInSpace Class Reference

Inherits from NSObject
Declared in BeaconsInSpace.h
BeaconsInSpace.m

Overview

BeaconsInSpace provides foreground and background beacon detection for all beacons subscribed to the API key set in the class method provideAPIKey:

This category provides additional support for applications that are already receiving location updates

Other Methods

+ provideAPIKey:

Provides your API key to the BeaconsInSpace iOS SDK. This key can be found in your account on missionControl.beaconsinspace.com, and can be optionally linked to your app’s bundle id. This must be called before the beaconManager class method, and should not be called again as it will reset your current beacon monitoring session.

+ (BeaconsInSpace *)provideAPIKey:(NSString *)apiKey

Parameters

apiKey

The key associated with this app on missioncontrol.beaconsinspace.com

Discussion

If an invalid API Key is provided this will raise an exception.

Declared In

BeaconsInSpace.h

+ beaconManager

Provides the shared instance of BeaconsInSpace for the BeaconsInSpace SDK for iOS. This object persists throughout the app lifecycle and monitors the nearby beacons registered to the API key set in the class method provideAPIKey:

+ (BeaconsInSpace *)beaconManager

Discussion

This method will throw an exception if the API Key has not previously been validated through the class method provideAPIKey:

Declared In

BeaconsInSpace.h

  enterRegionProximityTrigger

The BeaconsInSpaceDelegate method didBeginBISVisit: will only be called when proximity to the region is less than or equal to enterRegionProximityTrigger. Defaults to BISProximityFar

@property (nonatomic) BISProximity enterRegionProximityTrigger

Declared In

BeaconsInSpace.h

  currentVisits

The current BISRegions detected encapsulated in BISVisit objects, which provide the time entered and the total duration of the visit

@property (nonatomic, strong, readonly) NSArray<BISVisit*> *currentVisits

Declared In

BeaconsInSpace.h

– addDelegate:

Adds an object subscribing to the BeaconsInSpaceDelegate protocol to the available delegates

- (void)addDelegate:(id<BeaconsInSpaceDelegate>)delegate

Parameters

delegate

NSObject that adopts the BeaconsInSpaceDelegate protocol

Declared In

BeaconsInSpace.h

– nearestRegions:withCompletion:

Returns the nearest regions to the current user location if currently within a known region. Otherwise returns nil. Regions returned are sorted by distance closest to furthest

- (void)nearestRegions:(NSNumber *)limit withCompletion:(void ( ^ ) ( NSArray<BISRegion*> *nearbyRegions , NSError *__nullable error ))completion

Parameters

limit

Specifies the number of regions to be returned. The maximum is 20. Values greater than 20 will return 20 regions.

completion

Block that returns the nearest regions in an NSArray of BISRegion objects upon completion of the web call. Returns an empty array if not currently inside a known region.

Declared In

BeaconsInSpace.h

+ sdkVersion

Returns the version for this release of the BeaconsInSpace iOS SDK.

+ (NSString *)sdkVersion

Declared In

BeaconsInSpace.h

LocationAware Methods

+ updateCurrentLocation:

Provides the BeaconsInSpace class with the current user location. The beaconManager will immediately begin detecting beacons near to your location. Call this method whenever your app receives a location update.

+ (void)updateCurrentLocation:(CLLocation *)location

Parameters

location

The most recent location update received by the application

Discussion

This method will throw an exception if the API Key has not previously been validated in the class method provideAPIKey: If your app does not receive location updates at least every 10 minutes, do not implement this method.

Declared In

BeaconsInSpace+LocationAware.h

– nearestRegions:currentLocation:withCompletion:

Returns the nearest regions to the current user location provided as the location parameter. Regions returned are sorted by distance closest to furthest

- (void)nearestRegions:(NSNumber *)limit currentLocation:(CLLocation *)location withCompletion:(void ( ^ ) ( NSArray<BISRegion*> *nearbyRegions , NSError *__nullable error ))completion

Parameters

limit

specifies the number of regions to be returned. The maximum is 20. Values greater than 20 will return 20 regions.

location

The current user location

completion

Block that returns the nearest regions in an NSArray of BISRegion objects upon completion of the web call.

Declared In

BeaconsInSpace+LocationAware.h