Determine whether bluetooth is enabled on iOS (passively)
When building When building for Venmo, we wanted to be able to let the user know that they needed to turn Bluetooth on in order to see people nearby & most of the available options either triggered a permissions dialog, or a dialog letting the user know to turn Bluetooth on at app open.. neither of which we want.
Eventually we found the CBCentralManagerOptionShowPowerAlertKey
key, which can be passed to the initWithDelegate:queue:options:
method on CBCentralManager
which will cause iOS to start the Central Manager & not prompt the user to enable bluetooth. Voilla.. a totally passive way to check if bluetooth is enabled.
Note: The CBCentralManagerOptionShowPowerAlertKey
was introduced in iOS 7
Let's talk about it.
Head on over to Twitter and let's talk more.
Find me at @chrismaddern.