ratkevich ratkevich - 1 month ago 132
iOS Question

UIApplicationOpenSettingsURLString not work in iOS 10

In iOS 10, do not open settings url:

[[UIApplication sharedApplication] openURL:[NSURL URLWithString:UIApplicationOpenSettingsURLString]];


What is the problem?

Answer

I did like that and it's works. I'm test it today!

 NSURL *url = [NSURL URLWithString:UIApplicationOpenSettingsURLString];
 [[UIApplication sharedApplication] openURL:url];

Swift 3:

let urlObj = NSURL.init(string:UIApplicationOpenSettingsURLString)
if #available(iOS 10.0, *) {
    UIApplication.shared.open(urlObj as! URL, options: [ : ], completionHandler: { Success in

     })
} else {
      //fallbacks for previous versions                              
}
Comments