fluttercommunity / fluttercommunity/flutter_webview_plugin

JavascriptChannel on iOS

未关闭
#712 2 条评论 1 个 reaction 已指派 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(),
);
}

```

贡献指南

这个仓库没有索引到贡献指南

调研方向

从 WebviewScaffold 和 issue 中所示的 javascriptChannels 配置开始,然后在 iOS 上重现消息流,并将其与 Android 进行比较。完成的标准是:issue 记录了已确认的 iOS 特定要求,或记录了一个可复现的失败及范围明确的修复和验证步骤。

由索引模型根据 Issue 内容生成。

评估

技术栈
flutter
领域
mobile
Issue 类型
缺陷
难度
4/5
预计耗时
3-5 天
活跃度
停滞
描述清晰度
需要澄清
新手友好度
25/100

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。