PhoneGap和WhatsApp [英] PhoneGap and WhatsApp
问题描述
我希望您能帮我找到我的问题的一个问题。
I hope you'll can help me to find an issue to my problem.
我正在开发一个应该使用WhatsApp的应用程序。此应用程序使用HTML5,CSS3和Javascript。我使用此链接与WhatsApp发送消息:
I'm developping an application who should use WhatsApp. This application is using HTML5, CSS3 and Javascript. I am using this link to send an message with WhatsApp :
<a href="whatsapp://send?text=Test 1">
当你直接使用浏览器但是当我使用PhoneGap时,这个链接工作得很好我有一个这样的错误:
This link work perfectly when you use directly a browser but when I use PhoneGap I have a error like this :
net :: ERR_UNKNOWN_URL_SCHEME
net::ERR_UNKNOWN_URL_SCHEME
我测试了一些问题,但不工作。我也检查了文档,但没有...
I have tested some issues but doesn't work. I have also checked the Documentation but nothing...
你能帮我吗?
感谢
EDIT
这里是我解决我的问题:
Here is my solution to my problem:
<access origin="whatsapp:*" launch-external="yes" />
非常感谢:)
推荐答案
将此行添加到config.xml
Add this line to your config.xml
<access origin="whatsapp:*" launch-external="yes" />
或使用社交分享外挂程式
Or use the social sharing plugin
https://github.com/EddyVerbruggen/SocialSharing-PhoneGap-Plugin
<button onclick="window.plugins.socialsharing.shareViaWhatsApp('Message via WhatsApp', null /* img */, null /* url */, function() {console.log('share ok')}, function(errormsg){alert(errormsg)})">msg via WhatsApp (with errcallback)</button>
这篇关于PhoneGap和WhatsApp的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!