Explanation -: 1. I am working on ionic project where I am trying to share link via whatsapp
I have used
shareViaWhatsApp(message, image, url)function from https://ionicframework.com/docs/native/social-sharing/I have followed all the steps looking into the doc given by Ionic
But PROBLEM is -:
When I am trying to share link via whatsapp window opens but it gives a message sharing failed please try again then whatsapp window closed , and sharing failed
I am putting code below -:
shareViaWhatsapp(){
console.log('invitewhatsapp');
let message = 'Abcd';
//let image = 'sdfgbdh.jpg';
let url = "www.facebook.com";
this.socialShare
.shareViaWhatsApp(message,url,null)
.then(() => {
console.log('success');
})
.catch(() => {
console.log('Error');
});
}
html ->
<button ion-fab (click)="shareViaWhatsapp()"><ion-icon name="logo-whatsapp"></ion-icon></button>