Skip to content

Commit f1792ff

Browse files
imhoffdikeith
andauthored
fix(ios): only open a URL when the application is active (#3382)
Co-authored-by: Ian Keith <iankeith@gmail.com>
1 parent b92a887 commit f1792ff

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

ios/Capacitor/Capacitor/CAPBridgeViewController.swift

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -260,7 +260,9 @@ public class CAPBridgeViewController: UIViewController, CAPBridgeDelegate, WKScr
260260
}
261261

262262
if navUrl.absoluteString.range(of: hostname!) == nil && (navigationAction.targetFrame == nil || (navigationAction.targetFrame?.isMainFrame)!) {
263-
UIApplication.shared.open(navUrl, options: [:], completionHandler: nil)
263+
if UIApplication.shared.applicationState == .active {
264+
UIApplication.shared.open(navUrl, options: [:], completionHandler: nil)
265+
}
264266
decisionHandler(.cancel)
265267
return
266268
}

0 commit comments

Comments
 (0)