SBKBeaconManager Class Reference
| Inherits from | NSObject |
| Declared in | SBKBeaconManager.h |
Overview
The SBKBeaconManager class defines the interface for configuring the delivery of beacon-related events to your application. You use an instance of this class to get SBKBeacon objects, and establish the parameters that determine which beacon’s events should be delivered.
You should always use the shared instance. Creating own instance is not allowed.
Tasks
Getting the Instance
Setting and Getting the Delegate
-
delegateproperty
Initiating Beacon Ranging
-
– requestAlwaysAuthorization -
– requestWhenInUseAuthorization -
– startRangingBeaconsWithID:wakeUpApplication: -
– stopRangingBeaconsWithID: -
– stopRangingAllBeacons -
– addBroadcastKey: -
– registerBeaconAppearWatcher:type:watcher: -
– rangedBeaconIDs
Getting the Instance of Beacons
Configuration
-
outOfRangeDelayproperty -
versionproperty -
duplicateKeyBLEproperty
Properties
delegate
The delegate of the app object.
@property (nonatomic, weak) id<SBKBeaconManagerDelegate> delegateDiscussion
The delegate of the app object.
Declared In
SBKBeaconManager.hduplicateKeyBLE
- Set whether enable duplicate key for scanning device in background mode.
- default is NO,To set this property before call startRangingBeaconsWithID. *
- @discussion if set this property to YES, the SDK will continuously receive packet from device, but this increase the power consumption, NO, SDK will receive one packet from device unless this packet was changed.
@property (readwrite, nonatomic) BOOL duplicateKeyBLEDiscussion
- Set whether enable duplicate key for scanning device in background mode.
- default is NO,To set this property before call startRangingBeaconsWithID. *
- @discussion if set this property to YES, the SDK will continuously receive packet from device, but this increase the power consumption, NO, SDK will receive one packet from device unless this packet was changed.
Declared In
SBKBeaconManager.houtOfRangeDelay
Delay out of range notifications delivering.
@property (readwrite, nonatomic) NSTimeInterval outOfRangeDelayDiscussion
Delay out of range notifications delivering.
In order to prevent notifications delivering too frequently, beacon will not be marked out of range immediately. Default value is 8 seconds, means a beacon will be marked out of range if it can not be ranged in last 8 seconds.
Declared In
SBKBeaconManager.hClass Methods
sharedInstance
Returns the shared instance of the SBKBeaconManager class. Users are not allowed to create own instance.
+ (SBKBeaconManager *)sharedInstanceDiscussion
Returns the shared instance of the SBKBeaconManager class. Users are not allowed to create own instance.
Declared In
SBKBeaconManager.hInstance Methods
addBroadcastKey:
Set the secret info to decrypt the broadcast info.
- (BOOL)addBroadcastKey:(NSString *)secretInfoParameters
- secretInfo
the secret info.
Discussion
Set the secret info to decrypt the broadcast info.
Declared In
SBKBeaconManager.hallBeacons
Get all the beacon instances.
- (NSArray *)allBeaconsReturn Value
Beacon instances in array.
Discussion
Get all the beacon instances.
Declared In
SBKBeaconManager.hbeaconWithCLBeacon:
Get the beacon instance with CLBeacon object.
- (SBKBeacon *)beaconWithCLBeacon:(CLBeacon *)beaconParameters
- beacon
Using CLBeacon object to identify the sensoro beacon you want.
Return Value
SBKBeacon instance.
Discussion
Get the beacon instance with CLBeacon object.
This mehtod will return a sensoso beacon corresponding CLBeacon object. if this beacon is not a sensoro beacon, it will return nil.
Declared In
SBKBeaconManager.hbeaconWithID:
Get the beacon instance with SBKBeaconID object.
- (SBKBeacon *)beaconWithID:(SBKBeaconID *)beaconIDParameters
- beaconID
Using SBKBeaconID object to identify the beacon you want.
Return Value
Beacon instance.
Discussion
Get the beacon instance with SBKBeaconID object.
This mehtod will return nil if the beacon has not been ranged. The beacon with same ID will only have one instance.
Warning: The SBKBeaconID object must have major and minor properties.
Declared In
SBKBeaconManager.hbeaconsInRange
Get the beacon instances in range now.
- (NSArray *)beaconsInRangeReturn Value
Beacon instances in array, sorted by accuracy.
Discussion
Get the beacon instances in range now.
Declared In
SBKBeaconManager.hdisableBLEPowerAlert
Disable the alert that was showed when BLE was power off. Defualt was show the alert dialog. You can call this method to disable this alert, before call other method.
- (void)disableBLEPowerAlertDiscussion
Disable the alert that was showed when BLE was power off. Defualt was show the alert dialog. You can call this method to disable this alert, before call other method.
Declared In
SBKBeaconManager.hrangedBeaconIDs
The set of SBKBeaconID currently being ranged.
- (NSSet *)rangedBeaconIDsReturn Value
The objects in the set are instances of the SBKBeaconID class
Discussion
The set of SBKBeaconID currently being ranged.
Declared In
SBKBeaconManager.hregisterBeaconAppearWatcher:type:watcher:
Regiser a watcher to do something for new beacon.
- (void)registerBeaconAppearWatcher:(NSString *)identifier type:(u_int8_t)type watcher:(SBKBeaconWatcher)watcherParameters
- identifier
serial number or uuid, major, minor (UUID|MAJOR|MINOR).
- type
identifier’s type, 0: serial number, 1: uuid, major, minor.
- watcher
call this method when beacon will appear.
Discussion
Regiser a watcher to do something for new beacon.
Regiser a watcher to do something for new beacon that need setting before call didRangeNewBeacon, for example set beacon’s inRangeMinimumRssiWhileEntering. for every indentifier in lifetime just call once. To call didRangeNewBeacon for a beacon may be many times, because you can enter a beacon many times;
Declared In
SBKBeaconManager.hrequestAlwaysAuthorization
Requests permission to use location services whenever the app is running.
- (void)requestAlwaysAuthorizationDiscussion
Requests permission to use location services whenever the app is running.
When the current authorization status is kCLAuthorizationStatusNotDetermined, calling this method prompts the user to grant permission to the app to use location services.The user prompt contains the text from the NSLocationAlwaysUsageDescription key in your app’s Info.plist file, and the presence of that key is required when calling this method. You must call this method or the requestWhenInUseAuthorization method prior to using location services. If the current authorization status is anything other than kCLAuthorizationStatusNotDetermined, this method does nothing. for detail Apple’s requestAlwaysAuthorization
Declared In
SBKBeaconManager.hrequestWhenInUseAuthorization
Requests permission to use location services while the app is in the foreground.
- (void)requestWhenInUseAuthorizationDiscussion
Requests permission to use location services while the app is in the foreground.
When the current authorization status is kCLAuthorizationStatusNotDetermined, calling this method prompts the user to grant permission to the app to use location services. The user prompt contains the text from the NSLocationWhenInUseUsageDescription key in your app’s Info.plist file, and the presence of that key is required when calling this method. You must call this method or the requestAlwaysAuthorization method prior to using location services. If the current authorization status is anything other than kCLAuthorizationStatusNotDetermined, this method does nothing. for detail Apple’s requestWhenInUseAuthorization
Declared In
SBKBeaconManager.hstartRangingBeaconsWithID:wakeUpApplication:
Starts the delivery of notifications for beacons with specified id.
- (void)startRangingBeaconsWithID:(SBKBeaconID *)beaconID wakeUpApplication:(BOOL)wakeUpApplicationParameters
- beaconID
Using SBKBeaconID object to identify the beacons.
- wakeUpApplication
Wake up your application in background when those beacons being ranged.
Discussion
Starts the delivery of notifications for beacons with specified id.
Declared In
SBKBeaconManager.hstopRangingAllBeacons
Stops the delivery of notifications for all beacons.
- (void)stopRangingAllBeaconsDiscussion
Stops the delivery of notifications for all beacons.
Declared In
SBKBeaconManager.hstopRangingBeaconsWithID:
Stops the delivery of notifications for beacons with specified id.
- (void)stopRangingBeaconsWithID:(SBKBeaconID *)beaconIDParameters
- beaconID
Using SBKBeaconID object to identify the beacons.
Discussion
Stops the delivery of notifications for beacons with specified id.
Declared In
SBKBeaconManager.h