getVariationsHeader static method

Future<String?> getVariationsHeader()

Gets the WebView variations encoded to be used as the X-Client-Data HTTP header.

The app is responsible for adding the X-Client-Data header to any request that may use variations metadata, such as requests to Google web properties. The returned string will be a base64 encoded ClientVariations proto: https://source.chromium.org/chromium/chromium/src/+/main:components/variations/proto/client_variations.proto

The string may be empty if the header is not available.

NOTE for Android native WebView: This method should only be called if WebViewFeature.isFeatureSupported returns true for WebViewFeature.GET_VARIATIONS_HEADER.

Officially Supported Platforms/Implementations:

Implementation

static Future<String?> getVariationsHeader() =>
    PlatformInAppWebViewController.static().getVariationsHeader();