fluttercommunity / fluttercommunity/flutter_webview_plugin

JavascriptChannel on iOS

オープン
#712 コメント 2 件 リアクション 1 件 担当者 0 名 GitHub で見る
主要言語
Java
スター
1.5k
フォーク
938
PR マージ指標
30日以内にマージされた PR はありません

説明

I use JavascriptChannel to pass a string back to the app form webview.
It works perfectly for Android but can't make it work on iOS? Is there anything specific I need to do to make it work?

```
class WebViewJavascriptChannel {
static Set getChannel(Function(String) handler) {
return [
JavascriptChannel(
name: 'JavascriptChannel',
onMessageReceived: (JavascriptMessage javascriptMessage) {
handler(javascriptMessage.message);
print(javascriptMessage.message);
}),
].toSet();
}
}

Widget _getBankIDWebView(String url) {
return WebviewScaffold(
javascriptChannels:
WebViewJavascriptChannel.getChannel(_updateString),
url: url,
withZoom: false,
hidden: true,
appBar: _getAppBar(),
);
}

```

コントリビューションガイド

このリポジトリのコントリビューションガイドは索引されていません

評価

この issue はまだ評価されていません。

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。