Whatsapp Intent doesn't work


I’m building my first hybrid app with Ionic, but I’m getting some problems here!

I’m trying to implemente a href call to WhatsApp (on android) like this.

<a class="button button-clear button-large" ng-href="whatsapp://send?text=Hello%20World!">
  <i class="icon ion-social-whatsapp t-green"></i>

But, When I click on the link nothing happens!

I already added the whitelist plugin and set the compileProvider on my module like this.


I’ve added those lines on my config.xml

<allow-intent href="tel:*" />
<allow-intent href="sms:*" />
<allow-intent href="whatsapp:*" />

If I try a call to href=“tel: xxx” the app shows the phone uri correctly.

I’m using

Cordova 5.4.1
NodeJs 4.2.4
Ionic 1.7.12
cordova plug-ins:
console, contacts, device, dialogs, inappbrowser, network information, splashscreen, whitelist and ionic keyboard.

Anyone know what I should do ?

Hi, i never use whatsapp intent directly. Can you try to use this plugin https://github.com/EddyVerbruggen/SocialSharing-PhoneGap-Plugin? It’s a good plugin for sharing content with the social networks, included whatsapp.

I’ve used opening of Whatsapp from within an Ionic app in the past.
Your config.xml should contain:
<access launch-external="yes" origin="whatsapp:*"/>

There’s no need to use ng-href here, no value to be evaluated. Does it work when you alter your config.xml like above and use the following snippet:

<a class="button button-clear button-large" href="whatsapp://send?text=Hello%20World!">
  <i class="icon ion-social-whatsapp t-green"></i> Open WhatsApp

Good luck.

how will i know that it will open whats app when i am running it on the browser