[英]getting message **sharing failed please try again** in ionic app when I try to share link via whatsapp
Explanation -: 1. I am working on ionic project where I am trying to share link via whatsapp 说明-: 1.我正在开发离子项目,试图通过whatsapp共享链接
I have used shareViaWhatsApp(message, image, url)
function from https://ionicframework.com/docs/native/social-sharing/ 我已经使用
shareViaWhatsApp(message, image, url)
函数从https://ionicframework.com/docs/native/social-sharing/
I have followed all the steps looking into the doc given by Ionic 我已经按照所有步骤查看了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 当我尝试通过whatsapp窗口打开共享链接但它提示消息共享失败时,请重试,然后关闭whatsapp窗口, 共享失败
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 -> html->
<button ion-fab (click)="shareViaWhatsapp()"><ion-icon name="logo-whatsapp"></ion-icon></button>
The second parameter is for the image and the third is for URL. 第二个参数用于图像,第三个参数用于URL。 Replace your code with this one:
用以下代码替换您的代码:
this.socialShare
.shareViaWhatsApp("Abcd",undefined,"www.facebook.com")
.then(() => {
console.log('success');
})
.catch(() => {
console.log('Error');
});
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.