ios 随时检测蓝牙是否开启_iOS CoreBluetooth被动检查蓝牙是否启用,而不提示用户打开蓝牙...
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, but before I do, I want to conduct an ...
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, but before I do, I want to conduct an "in the wild" survey of the number of users who already have Bluetooth turned on/leave Bluetooth on all the time. So, I would just like to check this in the background and send back to a server statistics on number of users with Bluetooth already on, without ever actually using Bluetooth communications.
I have successfully instantiated a CBCentralManager in my app and can retrieve the Bluetooth status both immediately after instantiation and when the Bluetooth state updates via centralManagerDidUpdateState:. So that is all good. The problem I am having is that if the state is CBCentralManagerStatePoweredOff, then the device brings up an alert prompting the user to "Turn On Bluetooth to Allow [app name] to Connect to Accessories". It is this prompt I am trying to avoid. At this stage I just wish to survey the number of users who leave Bluetooth On - I don't wish to use the Bluetooth connection.
So, is there a way to check the Bluetooth status without prompting the user if you don't intend on using the Bluetooth connection?
解决方案
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)