The following URL opens on iOS 8.3 and lower, but it does not work and iOS 9
let instagramURL = NSURL(string: \"instagram://app\")
Why won\
Swift 3.1, Swift 3.2, Swift 4
if let urlFromStr = URL(string: "instagram://app") {
if UIApplication.shared.canOpenURL(urlFromStr) {
if #available(iOS 10.0, *) {
UIApplication.shared.open(urlFromStr, options: [:], completionHandler: nil)
} else {
UIApplication.shared.openURL(urlFromStr)
}
}
}
Add these in Info.plist :
LSApplicationQueriesSchemes
instagram