iOS CoreBluetooth passively check if Bluetooth is enabled without prompting user to turn Bluetooth on

前端 未结 2 1201
逝去的感伤
逝去的感伤 2020-12-03 11:20

The scenario is as follows. I have an already deployed app being used by people. I am considering implementing some experimental Bluetooth Low Energy features, bu

相关标签:
2条回答
  • 2020-12-03 11:49

    iOS 7 has a new options parameter in the create of CBCentralManager to turn this off.

    I'd love a solution for earlier iOS.

    0 讨论(0)
  • 2020-12-03 12:03

    You can use the following when you initialise the CBCentralManager.

    NSDictionary *options = @{CBCentralManagerOptionShowPowerAlertKey: @NO};
    self.manager = [[CBCentralManager alloc] initWithDelegate:self queue:nil options:options];
    

    I may have not explained it correctly, please right into the comment if there's any concern.

    0 讨论(0)
提交回复
热议问题