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"]];
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"]];
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]];
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: