Open Safari from iOS application

Cannot bring the Safari browser to the foreground from an iOS application while other applications can be opened the same way.

STEPS TO REPRODUCE After executing the following code, the browser is not opened: if let url = URL(string: "com-apple-mobilesafari-tab://"), UIApplication.shared.canOpenURL(url) {

UIApplication.shared.open(url, options: [: ], completionHandler: nil)

}

After executing the following code, the browser is not opened

I’m not sure why you think that’d work. In general, you should only rely on URL schemes that are explicitly documented and, at least AFAIK, that’s not the case for com-apple-mobilesafari-tab.

I talk about this more in this post.

Share and Enjoy

Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@" + "apple.com"

Open Safari from iOS application
 
 
Q