Skip to content

Commit

Permalink
fix for ionic-team#5949
Browse files Browse the repository at this point in the history
  • Loading branch information
hermitdemschoenenleben committed Oct 12, 2022
1 parent 8e8414f commit cc970bb
Showing 1 changed file with 3 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -123,13 +123,9 @@ public void sendResponseMessage(PluginCall call, PluginResult successResult, Plu

boolean isValidCallbackId = !call.getCallbackId().equals(PluginCall.CALLBACK_ID_DANGLING);
if (isValidCallbackId) {
if (WebViewFeature.isFeatureSupported(WebViewFeature.WEB_MESSAGE_LISTENER) && javaScriptReplyProxy != null) {
javaScriptReplyProxy.postMessage(data.toString());
} else {
final String runScript = "window.Capacitor.fromNative(" + data.toString() + ")";
final WebView webView = this.webView;
webView.post(() -> webView.evaluateJavascript(runScript, null));
}
final String runScript = "window.Capacitor.fromNative(" + data.toString() + ")";
final WebView webView = this.webView;
webView.post(() -> webView.evaluateJavascript(runScript, null));
} else {
bridge.getApp().fireRestoredResult(data);
}
Expand Down

0 comments on commit cc970bb

Please sign in to comment.