Skip to content

Commit

Permalink
Bugfix FXIOS-11100 Fix 'Open in Focus' for iOS 18 (#24221)
Browse files Browse the repository at this point in the history
[FXIOS-11100] Fix Open in Focus for iOS 18
  • Loading branch information
mattreaganmozilla authored Jan 17, 2025
1 parent 7be07a4 commit 03f4bd6
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions focus-ios/OpenInFocus/ActionViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 03f4bd6

Please sign in to comment.