I have developed an app that should open a whatsapp chat using this plugin.
I installed it using ionic CLI ionic cordova plugin add https://github.com/ranjitpandit/whatsapp-phonegap-plugin.git and the used it as below:
home.page.ts
...
declare var cordova;
...
constructor(public platform: Platform) {}
chat() {
this.platform.ready().then(() => {
cordova.plugins.Whatsapp.send('+263783187321');
});
}
Then in home.page.html I then did this:
<ion-row>
<ion-col size="12" no-padding>
<img src="assets/imgs/chat.jpg" (click)="chat()" class="chat" />
</ion-col>
</ion-row>
The problem is that it's not opening a Whatsapp chat window when I click the image. Nothing happens. Please help. Thank you
Use https://wa.me/<number> where the <number> is a full phone number in international format. Omit any brackets, dashes, plus signs, and leading zeros when adding the phone number in international format. Universal links can also include a pre-filled message that will automatically appear in the text field of a chat.
This is how it works in 2019 with Ionic 4
In config.xml add:
<access launch-external="yes" origin="whatsapp://*" />
In your html:
<a href="whatsapp://send?phone=YOUR_NUMBER">Link<a>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With