简体   繁体   English

为什么我不能使用 cordova-plugin-x-socialsharing 在 MMS cordova ios 中共享消息和图像

[英]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.我在我的 cordova 项目中包含了cordova-plugin-x-socialsharing ,因此我可以使用 MMS 功能来共享消息和图像。 This works fine on Android, but I am having problems with iOS.这在 Android 上运行良好,但我在使用 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.我不知道可能是什么问题,我尝试在 web 中搜索类似情况,但找不到任何相关内容。 However, according to the cordova-plugin-x-socialsharing docs, it appears this is an issue with WhatsApp, but not MMS.但是,根据 cordova-plugin-x-socialsharing 文档,这似乎是 WhatsApp 的问题,而不是彩信的问题。 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:我在我的 config.xml 中包含了 cordova-plugin-x-socialsharing 插件,如下所示:

<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.基于官方 github 已经声明 iOS 将不会与图像一起使用消息/主题。 Either one will share to whatsapp only.任何一个都只会分享给whatsapp。

在此处输入图像描述

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

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

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