0

I want to open bluetooth setting page on click of one button. Currently, it is opening General page.

I am doing following for that:

[[UIApplication sharedApplication] openURL:[NSURL URLWithString:@"prefs:root=Bluetooth"]];
NSPratik
  • 4,714
  • 7
  • 51
  • 81
VJ_iOS
  • 1
  • 1

2 Answers2

0

Now you can open only current app settings, sorry ..... https://developer.apple.com/library/ios/releasenotes/General/WhatsNewIniOS/Articles/iOS8.html

You can on/off bluetooth by

BluetoothManager *manager = [BluetoothManager sharedInstance];
[manager setEnabled:![manager enabled]];   
Elangovan
  • 1,158
  • 1
  • 9
  • 26
0

Use this URL Scheme:

prefs:root=General&path=Bluetooth

Below is the code:

NSURL*url=[[NSURL alloc] initWithString:@"prefs:root=General&path=Bluetooth"];
    if ([[UIApplication sharedApplication] canOpenURL:url]) {
        [[UIApplication sharedApplication] openURL:url];
    }

This will work for opening General screen in Settings for bluetooth

P.S.: Don't forget to add URL Types in targets info.plist file as shown below:

URL Types

iYoung
  • 3,596
  • 3
  • 32
  • 59