小编Arp*_*pit的帖子

在ios的背景中连续显示"打开蓝牙以允许应用程序连接到附件"警报消息

我在我的应用程序中使用iBeacon技术.我正在检查应用程序是否已启用蓝牙或由用户禁用,并且我已在下面编写代码.

 - (void)viewDidLoad 
 {
  [super viewDidLoad];
  _bluetoothManager =  [[CBCentralManager alloc] initWithDelegate:self queue:nil options:nil];
}

  // bluetooth manager state change
  - (void)centralManagerDidUpdateState:(CBCentralManager *)central
 {
 NSString *stateString = nil;
 switch(central.state)
 {
    case CBCentralManagerStateResetting: stateString = @"The connection with the system service was momentarily lost, update imminent."; break;
    case CBCentralManagerStateUnsupported: stateString = @"The platform doesn't support Bluetooth Low Energy."; break;
    case CBCentralManagerStateUnauthorized: stateString = @"The app is not authorized to use Bluetooth Low Energy."; break;
    case CBCentralManagerStatePoweredOff: stateString = @"Bluetooth is currently powered …
Run Code Online (Sandbox Code Playgroud)

bluetooth ios core-bluetooth

2
推荐指数
1
解决办法
8036
查看次数

标签 统计

bluetooth ×1

core-bluetooth ×1

ios ×1