diff --git a/packages/webview_flutter/CHANGELOG.md b/packages/webview_flutter/CHANGELOG.md index 63502241e..6caabf437 100644 --- a/packages/webview_flutter/CHANGELOG.md +++ b/packages/webview_flutter/CHANGELOG.md @@ -1,3 +1,7 @@ +## 0.9.2 + +* Supports multiple JavaScriptChannel method call. + ## 0.9.1 * Add ewk_set_version_policy() call. diff --git a/packages/webview_flutter/README.md b/packages/webview_flutter/README.md index 13fb06605..563e19eaf 100644 --- a/packages/webview_flutter/README.md +++ b/packages/webview_flutter/README.md @@ -23,7 +23,7 @@ This package is not an _endorsed_ implementation of `webview_flutter`. Therefore ```yaml dependencies: webview_flutter: ^4.4.2 - webview_flutter_tizen: ^0.9.1 + webview_flutter_tizen: ^0.9.2 ``` ## Example diff --git a/packages/webview_flutter/lib/src/tizen_webview.dart b/packages/webview_flutter/lib/src/tizen_webview.dart index 67560c01a..9e7b00a4f 100644 --- a/packages/webview_flutter/lib/src/tizen_webview.dart +++ b/packages/webview_flutter/lib/src/tizen_webview.dart @@ -52,7 +52,13 @@ class TizenWebView { Future _invokeChannelMethod(String method, [dynamic arguments]) async { if (!_isCreated) { - _pendingMethodCalls[method] = arguments; + if (method == 'addJavaScriptChannel' || + method == 'runJavaScript' || + method == 'runJavaScriptReturningResult') { + _pendingMethodCalls['${method}_$arguments'] = arguments; + } else { + _pendingMethodCalls[method] = arguments; + } return null; } @@ -79,7 +85,17 @@ class TizenWebView { } _pendingMethodCalls.forEach((String method, dynamic arguments) { - _tizenWebViewChannel.invokeMethod(method, arguments); + if (method.contains('addJavaScriptChannel_')) { + _tizenWebViewChannel.invokeMethod( + 'addJavaScriptChannel', arguments); + } else if (method.contains('runJavaScript_')) { + _tizenWebViewChannel.invokeMethod('runJavaScript', arguments); + } else if (method.contains('runJavaScriptReturningResult_')) { + _tizenWebViewChannel.invokeMethod( + 'runJavaScriptReturningResult', arguments); + } else { + _tizenWebViewChannel.invokeMethod(method, arguments); + } }); _pendingMethodCalls.clear(); } diff --git a/packages/webview_flutter/pubspec.yaml b/packages/webview_flutter/pubspec.yaml index a0991158d..5dccbe486 100644 --- a/packages/webview_flutter/pubspec.yaml +++ b/packages/webview_flutter/pubspec.yaml @@ -2,7 +2,7 @@ name: webview_flutter_tizen description: Tizen implementation of the webview_flutter plugin. homepage: https://github.com/flutter-tizen/plugins repository: https://github.com/flutter-tizen/plugins/tree/master/packages/webview_flutter -version: 0.9.1 +version: 0.9.2 environment: sdk: ">=3.1.0 <4.0.0"