SWRLBeaconManager Class Reference
Inherits from | SWRLManager : NSObject |
---|---|
Conforms to | SWRLBeaconScannerDelegate |
Declared in | SWRLBeaconManager.h SWRLBeaconManager.m |
Overview
The SWRLBeaconManager class is instantiated by the framework to coordinate and manage SWRLBeacons. An instance of this class is created when the framework is initialized and started when the SWRLSwirl start: is called. For the most part, you do not need to interact with this class directly. If you are interested in beacon level events and transitions, then you would add a delegate through the Swirl class and implement delegate methods. For information about the delegate methods you use to receive events, see SWRLBeaconManagerDelegate.
Accessing Beacon Manager State
nearest
The beacon currently determined to be closest to the mobile device.
@property (nonatomic, readonly, nullable) SWRLBeacon *nearest
Declared In
SWRLBeaconManager.h
allBeacons
All of the beacons currently managed by the beacon manager, including beacons that may be in an error state.
@property (nonatomic, nullable) NSArray<SWRLBeacon*> *allBeacons
Declared In
SWRLBeaconManager.h
activeBeacons
All of the active beacons currently managed by the beacon manager
@property (nonatomic, readonly, nullable) NSArray<SWRLBeacon*> *activeBeacons
Declared In
SWRLBeaconManager.h
activeDevices
All of the active beacons currently managed by the beacon manager, de-duped by peripheral
@property (nonatomic, readonly, nullable) NSArray<SWRLBeacon*> *activeDevices
Declared In
SWRLBeaconManager.h
– activeBeacons:
All of the active beacons currently managed by the beacon manager with a max age.
- (NSArray<SWRLBeacon*> *)activeBeacons:(NSTimeInterval)age
Parameters
age |
Maximum age for beacons returned |
---|
Declared In
SWRLBeaconManager.h
– activeDevices:rssi:flags:
All of the active devices currently managed by the beacon manager, filtered by age, rssi and flags.
- (NSArray<SWRLBeacon*> *)activeDevices:(NSTimeInterval)age rssi:(int)rssi flags:(SWRLBeaconFilter)flags
Parameters
age |
Maximum age for beacon devices returned. |
---|---|
rssi |
Only signals stronger than this value will be returned. |
flags |
See SWRLBeaconFilter for values |
Declared In
SWRLBeaconManager.h
– beaconWithIdentifier:urn:
Find a beacon by identifier or URN return nil.
- (SWRLBeacon *)beaconWithIdentifier:(nullable NSString *)identifier urn:(nullable NSString *)urn
Parameters
identifier |
Swirl returned identifier |
---|---|
urn |
an alternate beacon urn to look for |
Declared In
SWRLBeaconManager.h
– beaconWithIdentifier:urn:timeout:queue:completion:
Find a beacon by identifier or URN will complete when discovered, or resolved as parameters determine.
- (void)beaconWithIdentifier:(nullable NSString *)identifier urn:(nullable NSString *)urn timeout:(NSTimeInterval)timeout queue:(dispatch_queue_t)queue completion:(void ( ^ ) ( SWRLBeacon *_Nullable , NSError *_Nullable ))completion
Parameters
identifier |
Swirl returned identifier |
---|---|
urn |
Alternative beacon urn to look for |
timeout |
Interval to remain pending, after which the operation will timeout |
queue |
dispatch_queue to return completion on |
completion |
completion to call with result |
Declared In
SWRLBeaconManager.h