Reputation: 123
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
Upvotes: 0
Views: 744
Reputation: 293
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
Upvotes: 0