Created
October 26, 2016 10:14
-
-
Save Toldy/fb7d48bc4599e792a6c5cb4264fe26cc to your computer and use it in GitHub Desktop.
Deeplink app to app
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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