说明-: 1.我正在从事离子项目,试图通过whatsapp共享链接
我使用了https://ionicframework.com/docs/native/social-sharing/中的shareViaWhatsApp(message, image, url)
函数
我已经按照所有步骤查看了Ionic提供的文档
但是问题是-:
当我尝试通过whatsapp窗口共享链接时,该窗口提示您共享失败,请重试 然后whatsapp窗口关闭,并且共享失败
我将代码放在下面-:
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>
答案 0 :(得分:1)
第二个参数用于图像,第三个参数用于URL。用以下代码替换您的代码:
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="Autofac" publicKeyToken="17863af14b0044da" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-4.8.1.0" newVersion="4.8.1.0" />
</dependentAssembly>
</assemblyBinding>
</runtime>