onLoadResourceWithCustomScheme method

  1. @SupportedPlatforms.new(platforms: [AndroidPlatform(), IOSPlatform(apiName: 'WKURLSchemeHandler', apiUrl: 'https://developer.apple.com/documentation/webkit/wkurlschemehandler'), MacOSPlatform(apiName: 'WKURLSchemeHandler', apiUrl: 'https://developer.apple.com/documentation/webkit/wkurlschemehandler'), WindowsPlatform()])
FutureOr<CustomSchemeResponse?>? onLoadResourceWithCustomScheme(
  1. WebResourceRequest request
)

Event fired when the WebView finds the custom-scheme while loading a resource. Here you can handle the url request and return a CustomSchemeResponse to load a specific resource encoded to base64.

Officially Supported Platforms/Implementations:

Parameters - Officially Supported Platforms/Implementations:

  • request: all platforms

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

Implementation

@SupportedPlatforms(
  platforms: [
    AndroidPlatform(),
    IOSPlatform(
      apiName: 'WKURLSchemeHandler',
      apiUrl:
          'https://developer.apple.com/documentation/webkit/wkurlschemehandler',
    ),
    MacOSPlatform(
      apiName: 'WKURLSchemeHandler',
      apiUrl:
          'https://developer.apple.com/documentation/webkit/wkurlschemehandler',
    ),
    WindowsPlatform(),
  ],
)
FutureOr<CustomSchemeResponse?>? onLoadResourceWithCustomScheme(
  WebResourceRequest request,
) {
  return null;
}