Cordova通过WhatsApp从WebView内部点击进行分享

我有我的应用程序与cordova(5.5.1)build立,我试图通过WhatsApp分享url。 我使用以下协议: whatsapp://send?text= test

如果我在移动浏览器上打开我的网站,它正在工作。 在iOS上也是如此。

我已经尝试添加这个<access origin="whatsapp:*" launch-external="yes" />到我的config.xml中,但它仍然不起作用。

我正在使用InAppBrowser,这就是我打开我的webview

var ref = window.open("http://m.estadao.com.br/?load-all=true", "_blank", "location=no", "toolbar=no", "closebuttoncaption=a", "EnableViewPortScale=no");

这是错误: 错误cordova whatsapp

任何想法如何解决这个问题?

我解决了它编辑插件InAppBrowser.java的核心

改变了这一点

 else if (url.startsWith("geo:") || url.startsWith(WebView.SCHEME_MAILTO) || url.startsWith("market:")){ try { Intent intent = new Intent(Intent.ACTION_VIEW); intent.setData(Uri.parse(url)); cordova.getActivity().startActivity(intent); } catch (android.content.ActivityNotFoundException e) { LOG.e(LOG_TAG, "Error with " + url + ": " + e.toString()); } } 

 else if (url.startsWith("geo:") || url.startsWith(WebView.SCHEME_MAILTO) || url.startsWith("market:") || url.startsWith("whatsapp:")) { try { Intent intent = new Intent(Intent.ACTION_VIEW); intent.setData(Uri.parse(url)); cordova.getActivity().startActivity(intent); } catch (android.content.ActivityNotFoundException e) { LOG.e(LOG_TAG, "Error with " + url + ": " + e.toString()); } } 

在config.xml中添加<access origin="whatsapp:*" launch-external="yes" />也很重要。