简体   繁体   English

当我尝试通过whatsapp共享链接时,收到消息**共享失败,请重试**

[英]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共享链接

  1. 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/

  2. I have followed all the steps looking into the doc given by Ionic 我已经按照所有步骤查看了Ionic提供的文档

  3. 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');
  });

More info about share via whatsapp 有关通过whatsapp共享的更多信息

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 当Api返回响应时,如何以角度显示“登录失败。请重试”消息? - How to show “Login In failed.Please try again” message in angular when Api returns the response? Ionic Native paypal,系统错误,请稍后登录时重试 - Ionic Native paypal, System Error, please try again later when logging in 当我尝试在 Angular 中使用 SSR 启动离子应用程序时出现“TypeError: win.matchMedia is not a function” - Getting 'TypeError: win.matchMedia is not a function' when i try to start ionic app with SSR in Angular 当我尝试构建我的离子应用程序时,构建gradle中的一个问题 - A problem in the build gradle when i try to build my ionic app 离子电容器共享插件不与whatsapp共享图像 - ionic capacitor share plugin not sharing image with whatsapp 有什么方法可以在离子应用程序中实现再试一次按钮吗? - Is there any way to implement try again button into ionic app? 在Ionic期间遇到错误,尝试启动新应用程序(Ionic版本4.8.0)时无法正常工作 - Getting error during Ionic, Its not working when try to start new app (ionic version 4.8.0) 通过 Share_Target 将图像从 whatsapp 共享到 angular 应用程序不起作用 - Sharing images from whatsapp to angular app via Share_Target not working 当我尝试提交登录表单时,页面正在重新加载,没有获取表单组 -Ionic,Angular 的值 - When I try to submit the login form the page is reloading , not getting the values of form group -Ionic ,Angular Angular 2 + Ionic 2:对象推送到数组,但是当我尝试使用它时它为空 - Angular 2 + Ionic 2: objects push to array, but it is empty when I try to use it
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM