Skip to content

Instantly share code, notes, and snippets.

@Toldy
Created October 26, 2016 10:14
Show Gist options
  • Save Toldy/fb7d48bc4599e792a6c5cb4264fe26cc to your computer and use it in GitHub Desktop.
Save Toldy/fb7d48bc4599e792a6c5cb4264fe26cc to your computer and use it in GitHub Desktop.
Deeplink app to app
let urlScheme = "rogervoice://call?phone_number=0546832706"
if let url = NSURL(string: urlScheme) as? URL, UIApplication.shared.canOpenURL(url) {
if #available(iOS 10, *) {
UIApplication.shared.open(url, options: [:], completionHandler: { (success) in
print("Open \(urlScheme): \(success)")
})
} else {
let success = UIApplication.shared.openURL(url)
print("Open \(urlScheme): \(success)")
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment