onReceivedError method

  1. @SupportedPlatforms.new(platforms: [AndroidPlatform(apiName: 'WebViewClient.onReceivedError', apiUrl: 'https://developer.android.com/reference/android/webkit/WebViewClient#onReceivedError(android.webkit.WebView,%20android.webkit.WebResourceRequest,%20android.webkit.WebResourceError)'), IOSPlatform(apiName: 'WKNavigationDelegate.webView', apiUrl: 'https://developer.apple.com/documentation/webkit/wknavigationdelegate/1455623-webview'), MacOSPlatform(apiName: 'WKNavigationDelegate.webView', apiUrl: 'https://developer.apple.com/documentation/webkit/wknavigationdelegate/1455623-webview'), WindowsPlatform(apiName: 'ICoreWebView2.add_NavigationCompleted', apiUrl: 'https://learn.microsoft.com/en-us/microsoft-edge/webview2/reference/win32/iwebview2webview?view=webview2-0.8.355#add_navigationcompleted')])
void onReceivedError(
  1. WebResourceRequest request,
  2. WebResourceError error
)

Event fired when the WebView encounters an error loading a request.

Officially Supported Platforms/Implementations:

Parameters - Officially Supported Platforms/Implementations:

  • request: all platforms
  • error: all platforms

Use the PlatformInAppBrowserEvents.isMethodSupported method to check if this method is supported at runtime.

Implementation

@SupportedPlatforms(
  platforms: [
    AndroidPlatform(
      apiName: 'WebViewClient.onReceivedError',
      apiUrl:
          'https://developer.android.com/reference/android/webkit/WebViewClient#onReceivedError(android.webkit.WebView,%20android.webkit.WebResourceRequest,%20android.webkit.WebResourceError)',
    ),
    IOSPlatform(
      apiName: 'WKNavigationDelegate.webView',
      apiUrl:
          'https://developer.apple.com/documentation/webkit/wknavigationdelegate/1455623-webview',
    ),
    MacOSPlatform(
      apiName: 'WKNavigationDelegate.webView',
      apiUrl:
          'https://developer.apple.com/documentation/webkit/wknavigationdelegate/1455623-webview',
    ),
    WindowsPlatform(
      apiName: 'ICoreWebView2.add_NavigationCompleted',
      apiUrl:
          'https://learn.microsoft.com/en-us/microsoft-edge/webview2/reference/win32/iwebview2webview?view=webview2-0.8.355#add_navigationcompleted',
    ),
  ],
)
void onReceivedError(WebResourceRequest request, WebResourceError error) {}