I have a specific situation in my app that presents a UIAlertView
to a user with two buttons : Settings
and Ask me Later
. Ask Me Later is just a cancel
, but I want the Settings to either:
1) Open up the iCloud section of the iOS Settings app 2) If that's not possible, just open up the Settings.
This is an iOS 7 only app and I've come across plenty of articles that's saying this has stopped being supported past iOS 5. I'd completely accept that if the Authy app didn't offer the same thing.
In their app, as can be seen in the screenshot below, you're presented with the ability to go to the Bluetooth section of the settings and it works. I'm sure other apps do it too.
My code below currently doesn't do anything:
- (void)alertView:(UIAlertView *)alertView clickedButtonAtIndex:(NSInteger)buttonIndex {
if (buttonIndex != [alertView cancelButtonIndex])
{
NSLog(@"Settings selected");
NSURL*url=[NSURL URLWithString:@"prefs:root=General&path=Bluetooth"];
[[UIApplication sharedApplication] openURL:url];
}
Based on this Stack Overflow post (iOS UIAlertView button to go to Setting App) (which admittedly is old), I have tried most variations and I cannot get the Settings.app to open up. It doesn't do anything when I click on it.
If going to the iCloud section is not possible, I don't mind just sending the user to the Settings.app if that is possible?
Any thoughts would be appreciated.