addJavascriptChannels method
直接使用X5WebView(javascriptChannels:JavascriptChannels(names, (name, data) { }))
Implementation
@deprecated
Future<void> addJavascriptChannels(
List<String> names, MessageReceived callback) async {
await _channel.invokeMethod("addJavascriptChannels", {'names': names});
_channel.setMethodCallHandler((call) async {
if (call.method == "onJavascriptChannelCallBack") {
Map arg = call.arguments;
callback(arg["name"], arg["msg"]);
}
});
}