2

I want to enable/disable Bluetooth programmatically without using private API (which will be rejected by App Store). I just see CoreBluetooth can get current bluetooth state. Can I archive it with CoreBluetooth, I cannot find out any relevant information to that.

Thanks for any advanced help!!!

Lucy
  • 165
  • 2
  • 13

4 Answers4

5

You cannot enable or disable the Bluetooth radio through an app. You can disable your own app's use of Bluetooth but the Bluetooth radio will still be enabled.

Only the user can enable/disable Bluetooth through settings.

Paulw11
  • 108,386
  • 14
  • 159
  • 186
2

You cannot switch On/Off the bluetooth from your app as it is not available in the Core Bluetooth framework. You can simply pull out the Notification centre to switch it ON and Off which can easily serve your purpose.

Shikhar varshney
  • 816
  • 1
  • 9
  • 23
1

Yes, you can use Core Bluetooth Framework for this.

Just import the Bluetooth Manager Header file and write the following code on button click:

[btManager setPowered:YES];
[btManager setEnabled:YES];

In this example, btManager is an object of Bluetooth Manager class.

Tony Hinkle
  • 4,706
  • 7
  • 23
  • 35
0

I haven't seen any change in documentation that allow user to switch on/off bluetooth. The best it can do, it show the system pop-up to go to settings by calling CoreBluetooth methods. All other way should be for jailbroken devices or using private API that should get you rejected from AppStore Reviews