From 03f4bd6a659c4281a242cf6a3377cf7a7d208018 Mon Sep 17 00:00:00 2001 From: mattreaganmozilla <145381717+mattreaganmozilla@users.noreply.github.com> Date: Fri, 17 Jan 2025 14:41:31 -0800 Subject: [PATCH] Bugfix FXIOS-11100 Fix 'Open in Focus' for iOS 18 (#24221) [FXIOS-11100] Fix Open in Focus for iOS 18 --- focus-ios/OpenInFocus/ActionViewController.swift | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/focus-ios/OpenInFocus/ActionViewController.swift b/focus-ios/OpenInFocus/ActionViewController.swift index 9cfe224783f6..7a0e6a0ebda2 100644 --- a/focus-ios/OpenInFocus/ActionViewController.swift +++ b/focus-ios/OpenInFocus/ActionViewController.swift @@ -101,8 +101,14 @@ class ActionViewController: SLComposeServiceViewController { var responder = self as UIResponder? let selectorOpenURL = sel_registerName("openURL:") while responder != nil { - if responder!.responds(to: selectorOpenURL) { - responder!.callSelector(selector: selectorOpenURL, object: url, delay: 0) + if #available(iOS 18.0, *) { + if let application = responder as? UIApplication { + application.open(url as URL, options: [:], completionHandler: nil) + } + } else { + if responder!.responds(to: selectorOpenURL) { + responder!.callSelector(selector: selectorOpenURL, object: url, delay: 0) + } } responder = responder!.next