Created
February 28, 2019 19:59
-
-
Save rldaulton/c544b7fcb49a4c789812b4089f061f06 to your computer and use it in GitHub Desktop.
You should always check if a link is univeral, before opening it in any browser session of SFSafariView
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 url = URL(string: "https://youtu.be/5IVsLLlRNXc")! | |
UIApplication.shared.open(url, options: [.universalLinksOnly: true]) { (success) in | |
if !success { | |
// not a universal link or app not installed | |
let vc = SFSafariViewController(url: url) | |
self.present(vc, animated: true) | |
} | |
} |
@phansen-nd I have not, personally. But also, this code is many years old. There might be a better way to do this by now.
However, is your AASA being served over HTTPS? I think iOS will only retrieve it over a secure connection. You should be able to verify your AASA file with this tool.
Yeah the file looks okay with that tool. Just thought I'd check - thanks anyway!
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This seems like a good practice, but when I add this,
success
is always returningfalse
, even for links that match a path in our AASA file and that open the app successfully when tapped from outside the app. Have you encountered this issue?