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

ε祈祈猫儿з 提交于 2019-11-27 14:24:59
PatchyFog

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

I'd love a solution for earlier iOS.

Anas Azeem

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.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!