From 56bbfe713be8eac4682002e7d2191c48a0b73ede Mon Sep 17 00:00:00 2001 From: Maurice Parker Date: Wed, 1 Sep 2021 14:13:04 -0500 Subject: [PATCH] Fix regression that prevented universal links from working --- iOS/Article/WebViewController.swift | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/iOS/Article/WebViewController.swift b/iOS/Article/WebViewController.swift index cba86084f..232d62db1 100644 --- a/iOS/Article/WebViewController.swift +++ b/iOS/Article/WebViewController.swift @@ -351,8 +351,13 @@ extension WebViewController: WKNavigationDelegate { if AppDefaults.shared.useSystemBrowser { UIApplication.shared.open(url, options: [:]) } else { - let vc = SFSafariViewController(url: url) - self.present(vc, animated: true, completion: nil) + UIApplication.shared.open(url, options: [.universalLinksOnly: true]) { didOpen in + guard didOpen == false else { + return + } + let vc = SFSafariViewController(url: url) + self.present(vc, animated: true) + } } } else if components?.scheme == "mailto" {