简体   繁体   中英

Why can't I share both message and image in MMS cordova ios using cordova-plugin-x-socialsharing

I have included the cordova-plugin-x-socialsharing in my cordova project so I can use the MMS capabilities to share a message and image. This works fine on Android, but I am having problems with iOS. I can share text or an image, but I cannot share both together. Everything seems to work, and the native interface is opened, but if an image is present then the text is missing. I have no idea what might be the issue, I've tried searching the web for similar situations but can't find anything related. However, according to the cordova-plugin-x-socialsharing docs, it appears this is an issue with WhatsApp, but not MMS. If anyone has any ideas about what is causing this problem, or what I can do to fix it, that would be greatly appreciated.

I have included the cordova-plugin-x-socialsharing plugin in my config.xml like this:

<plugin name="cordova-plugin-x-socialsharing" spec="~5.6.5" />

The code I am using to send the message is as follows:

window.plugins.socialsharing.shareViaSMS(
    {
      message: "Test Message #helloworld",
      subject: "Test Message #helloworld",
      image: this.shareImageURL //local file system url
    },
    this.phoneNumber.replace(/\D/g, ""),
    function() {
      that.showPhoneNumber = false;
      that.phoneNumber = null;
    },
    function(e) {
      alert("An Error Occured While Sharing: " + JSON.stringify(e));
      that.showPhoneNumber = false;
      that.phoneNumber = null;
    }
  );

Again, I can share the image just fine, but the subject/message will not be included if I share the image. I've tried many different combinations, but nothing has worked so far

Base on the official github already declare iOS will not work message/subject with image together. Either one will share to whatsapp only.

在此处输入图像描述

Reference: https://github.com/codeborne/cordova-plugin-x-socialsharing#whatsapp

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM