diff --git a/src/BlazorWebView/src/Maui/iOS/IOSWebViewManager.cs b/src/BlazorWebView/src/Maui/iOS/IOSWebViewManager.cs index 527e58c2d714..99df9f08aea0 100644 --- a/src/BlazorWebView/src/Maui/iOS/IOSWebViewManager.cs +++ b/src/BlazorWebView/src/Maui/iOS/IOSWebViewManager.cs @@ -105,7 +105,6 @@ public WebViewUIDelegate(BlazorWebViewHandler webView) _webView = webView ?? throw new ArgumentNullException(nameof(webView)); } - public override void RunJavaScriptAlertPanel(WKWebView webView, string message, WKFrameInfo frame, Action completionHandler) { PresentAlertController( @@ -246,9 +245,13 @@ public override void DecidePolicy(WKWebView webView, WKNavigationAction navigati { _webView.Logger.LaunchExternalBrowser(uri); -#pragma warning disable CA1416, CA1422 // TODO: OpenUrl(...) has [UnsupportedOSPlatform("ios10.0")] - UIApplication.SharedApplication.OpenUrl(requestUrl); -#pragma warning restore CA1416, CA1422 + UIApplication.SharedApplication.OpenUrl(requestUrl, new UIApplicationOpenUrlOptions(), (success) => + { + if (!success) + { + _webView.Logger.LogError($"There was an error trying to open URL: {requestUrl}"); + } + }); } if (strategy != UrlLoadingStrategy.OpenInWebView)