简体   繁体   中英

Does iOS scan beacon even if bluetooth is off

I am developing app which interacts with iBeacon. I've seen my app is able to detect iBeacon even if bluetooth is off. I am unable to find any documentation of this behaviour. Can anyone share official verdict/documentation what actually is going on behind the scene?

Thanks

When you tap the Bluetooth icon in Control Center to turn it “off” the icon changes from Blue to Grey, but this does not turn off Bluetooth. It just disables Bluetooth connections while allowing iBeacon scanning and scanning for other Bluetooth devices to continue.

You can verify this for yourself by turning the Bluetooth icon to the off position in Control Center like this:

在此处输入图像描述

Then drill down into settings to see that the Bluetooth switch is still enabled but below that connections are now disabled.

在此处输入图像描述

You cannot detect if a phone is in this state, but if your app constructs a new CBCentralManager when the phone is in this state, iOS will automatically put up a dialog like this:

在此处输入图像描述

If you are not using CBCentralManager, then it doesn't make any difference whether the phone is in this state or not -- you can scan for other devices (iBeacon using CoreLocation or non-iBeacon bluetooth devices using CoreBluetooth) the same way regardless of whether the phone is in this mode.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM