Check if Bluetooth is Enabled?

14,907

Solution 1

The only way I've ever found to do this is with private frameworks (like Bluetooth Manager, for one) that are only useful for Jailbroken apps... and Apple will reject any app using a private framework. I believe it's even against their ToS to do anything with bluetooth, so you're out of luck there.

Solution 2

There seems to be an answer here - Using Core bluetooth framework

However, that answer will only work for iOS 5.0 and up. I haven't tested this myself, but will return and add feedback if I find that it works.

Solution 3

Unfortunately not, the SDK does not expose Bluetooth methods.

There may be a way to do it by using undocumented methods, however we all know the problem there.

Solution 4

You can now check this using the CBCentralManager in iOS 7 and initialize it with the CBCentralManagerOptionShowPowerAlertKey option set.

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.

Posted here: http://chrismaddern.com/determine-whether-bluetooth-is-enabled-on-ios-passively/

Share:
14,907
EmphaticArmPump
Author by

EmphaticArmPump

After earning two college degrees in business-related fields, I decided that there was a real future in programming. So I started from scratch with almost no prior experience.

Updated on June 17, 2022

Comments

  • EmphaticArmPump
    EmphaticArmPump almost 2 years

    I just want to do a simple check of whether bluetooth is enabled on the device or not.

    I don't want to change the status from inside an app (or at all), use private API's, jailbreak a device, or do anything that would cause Apple to reject an app.

    All I want is to know whether bluetooth is turned on or not.

    Can anyone shed any light on this? Is there any Apple-allowed way to do this?

    I am fully aware, after reading countless posts and documentation that Apple is very restrictive when it comes to Bluetooth (among other things).

    If you are only able to contribute to this question with a link to documentation and/or some snide remark about learning objective-c, reading documentation, etc., then please don't respond.

  • Ahmad Alfy
    Ahmad Alfy over 11 years
    Yes, they will reject the app cause they're a bunch of ****
  • Victor Ronin
    Victor Ronin almost 11 years
    Actually, it's not only useful for Jailbreakon, but also for apps signed with enterprise certificate.