setJavaScriptBridgeName static method
- String bridgeName
Sets the name of the JavaScript Bridge object that will be used to interact with the WebView. This method should be called before any WebViews are created or when there are no WebViews. Calling this method after a WebView has been created will not change the current JavaScript Bridge object and could lead to errors.
The bridgeName must be a non-empty string with only alphanumeric and underscore characters.
It can't start with a number.
The default name used by this plugin is flutter_inappwebview_forge.
Officially Supported Platforms/Implementations:
- Android WebView
- iOS WKWebView
- macOS WKWebView
- Web <iframe> but requires same origin
- Windows WebView2
- Linux WPE WebKit
Parameters - Officially Supported Platforms/Implementations:
bridgeName: all platforms
Use the PlatformInAppWebViewController.isMethodSupported method to check if this method is supported at runtime.
Implementation
static Future<void> setJavaScriptBridgeName(String bridgeName) =>
PlatformInAppWebViewController.static().setJavaScriptBridgeName(
bridgeName,
);