John Doe John Doe - 1 year ago 125
Android Question

PhoneGap and WhatsApp

I hope you'll can help me to find an issue to my problem.

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">

This link work perfectly when you use directly a browser but when I use PhoneGap I have a error like this :


I have tested some issues but doesn't work. I have also checked the Documentation but nothing...

Can you help me please ?


Answer Source

Add this line to your config.xml

<access origin="whatsapp:*" launch-external="yes" />

Or use the social sharing 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>
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download