BRTBeaconManager Class Reference
Inherits from | NSObject |
---|---|
Conforms to | CLLocationManagerDelegate |
Declared in | BRTBeaconManager.h |
Overview
BRTBeaconManager 类定义了操作Beacon、配置Bright Beacon,以及获取相关事件通知应用程序的接口。使用本类的实例来建立参数描述每个Beacon设备,你也可以检索范围内所有的beacon设备。
一个管理器提供支持以下位置相关的活动:
- 监测不同感兴趣的区域和生成定位事件当用户进入或离开这些区域(在后台模式)。
- 提供范围附近的Beacon设备和它的距离。
Other Methods
– rangedRegions
rangedRegions
- (NSSet *)rangedRegions
Return Value
NSSet
Discussion
rangedRegions
目前检测到正活跃的区域
Declared In
BRTBeaconManager.h
CoreLocation based iBeacon monitoring and ranging methods
– startRangingBeaconsInRegion:
范围扫描所有的可见的Beacon设备. 检索Beacon设备,通过回调函数beaconManager:didRangeBeacons:inRegion: 返回一个NSArray包含的 BRTBeacon 对象。
- (void)startRangingBeaconsInRegion:(BRTBeaconRegion *)region
Parameters
region |
bright beacon 区域 |
---|
Discussion
范围扫描所有的可见的Beacon设备. 检索Beacon设备,通过回调函数beaconManager:didRangeBeacons:inRegion: 返回一个NSArray包含的 BRTBeacon 对象。
Declared In
BRTBeaconManager.h
– startMonitoringForRegion:
开始监测区域Start monitoring for particular region. 该功能在后台也能够工作.(需要定位权限始终并打开蓝牙) 只要你进入或者离开区域,都会回调: beaconManager:didEnterRegtion: 或 beaconManager:didExitRegion:
- (void)startMonitoringForRegion:(BRTBeaconRegion *)region
Parameters
region |
bright beacon 区域 |
---|
Discussion
开始监测区域Start monitoring for particular region. 该功能在后台也能够工作.(需要定位权限始终并打开蓝牙) 只要你进入或者离开区域,都会回调: beaconManager:didEnterRegtion: 或 beaconManager:didExitRegion:
Declared In
BRTBeaconManager.h
– stopRangingBeaconsInRegion:
停止范围扫描beacon设备.
- (void)stopRangingBeaconsInRegion:(BRTBeaconRegion *)region
Parameters
region |
beacon 区域 |
---|
Discussion
停止范围扫描beacon设备.
Declared In
BRTBeaconManager.h
– stopMonitoringForRegion:
注销程序iOS区域检测
- (void)stopMonitoringForRegion:(BRTBeaconRegion *)region
Parameters
region |
Bright beacon region |
---|
Discussion
注销程序iOS区域检测
Declared In
BRTBeaconManager.h
– requestStateForRegion:
允许为特定区域验证当前状态
- (void)requestStateForRegion:(BRTBeaconRegion *)region
Parameters
region |
Bright beacon 区域 |
---|
Discussion
允许为特定区域验证当前状态
Declared In
BRTBeaconManager.h
转换设备为 iBeacon
– startAdvertisingWithProximityUUID:major:minor:identifier:power:
设备模拟成 iBeacon.使用此方法必须保持程序一直在前台运行。可以使用检测状态[[BRTBeaconSDK BRTBeaconManager] isAdvertising]
- (void)startAdvertisingWithProximityUUID:(NSUUID *)proximityUUID major:(CLBeaconMajorValue)major minor:(CLBeaconMinorValue)minor identifier:(NSString *)identifier power:(NSNumber *)power
Parameters
proximityUUID |
beacon设备UUID值 |
---|---|
major |
beacon设备major值 |
minor |
beacon设备minor值 |
identifier |
唯一的区域标识 |
power |
测量功率(1米处的RSSI值) |
Discussion
设备模拟成 iBeacon.使用此方法必须保持程序一直在前台运行。可以使用检测状态[[BRTBeaconSDK BRTBeaconManager] isAdvertising]
Declared In
BRTBeaconManager.h
– isAdvertising
是否正在模拟beacon广播
- (BOOL)isAdvertising
Discussion
是否正在模拟beacon广播
Declared In
BRTBeaconManager.h
– stopAdvertising
停止模拟beacon广播
- (void)stopAdvertising
Discussion
停止模拟beacon广播
Declared In
BRTBeaconManager.h
基于蓝牙CoreBluetooth方法
– scanBleServices:
开始蓝牙扫描,基于CoreBluetooth framework. 该方法用于扫描对应服务的蓝牙设备.
- (void)scanBleServices:(NSArray<CBUUID*> *)services
Discussion
开始蓝牙扫描,基于CoreBluetooth framework. 该方法用于扫描对应服务的蓝牙设备.
@prama services 蓝牙广播服务
Declared In
BRTBeaconManager.h
– requestAlwaysAuthorization
获取定位权限:允许后台定位,可以支持后台区域推送,网络数据传输等
- (void)requestAlwaysAuthorization
Discussion
获取定位权限:允许后台定位,可以支持后台区域推送,网络数据传输等
Declared In
BRTBeaconManager.h
– requestWhenInUseAuthorization
获取定位权限:只允许APP运行期间定位,不支持后台区域感知
- (void)requestWhenInUseAuthorization
Discussion
获取定位权限:只允许APP运行期间定位,不支持后台区域感知
Declared In
BRTBeaconManager.h
– startUpdateLocations:
开始获取用户GPS
- (void)startUpdateLocations:(locBlock)block
Parameters
block |
GPS |
---|
Discussion
开始获取用户GPS
Declared In
BRTBeaconManager.h
– stopUpdatingLocation
停止获取定位
- (void)stopUpdatingLocation
Discussion
停止获取定位
Declared In
BRTBeaconManager.h