fetchWebViewData method
- @SupportedPlatforms(platforms: [IOSPlatform(available: '26.0', apiName: 'WKWebView.fetchData(of:completionHandler:)', apiUrl: 'https://developer.apple.com/documentation/webkit/wkwebview/fetchdata(of:completionhandler:)'), MacOSPlatform(available: '26.0', apiName: 'WKWebView.fetchData(of:completionHandler:)', apiUrl: 'https://developer.apple.com/documentation/webkit/wkwebview/fetchdata(of:completionhandler:)')])
- required Set<
WebViewDataType> dataTypes,
Fetches a serialized blob of WebView data such as session storage.
Officially Supported Platforms/Implementations:
- iOS WKWebView 26.0+ (Official API - WKWebView.fetchData(of:completionHandler:))
- macOS WKWebView 26.0+ (Official API - WKWebView.fetchData(of:completionHandler:))
Parameters - Officially Supported Platforms/Implementations:
dataTypes: all platforms
Use the PlatformInAppWebViewController.isMethodSupported method to check if this method is supported at runtime.
Implementation
@SupportedPlatforms(
platforms: [
IOSPlatform(
available: '26.0',
apiName: 'WKWebView.fetchData(of:completionHandler:)',
apiUrl:
'https://developer.apple.com/documentation/webkit/wkwebview/fetchdata(of:completionhandler:)',
),
MacOSPlatform(
available: '26.0',
apiName: 'WKWebView.fetchData(of:completionHandler:)',
apiUrl:
'https://developer.apple.com/documentation/webkit/wkwebview/fetchdata(of:completionhandler:)',
),
],
)
Future<Uint8List?> fetchWebViewData({required Set<WebViewDataType> dataTypes}) {
throw UnimplementedError(
'${PlatformInAppWebViewControllerMethod.fetchWebViewData.name} is not implemented on the current platform',
);
}