social_share
social_share copied to clipboard
Cannot share image to whatsapp from shareOptions
When calling SocialShare.shareOptions('some text', imagePath: imagePath);
and choosing WhatsApp, only 'some text' is sent, not the image. This is working perfectly on Telegram, Instagram, Mail, etc.
Couldn't try it with Android, I tested this with iOS.
works on android I think there's some issue with ios. Thanks for pointing it out, ill push an update soon for this
I see the this issue on iOS. On Android, sharing both image and text to WhatsApp seems to work. Can I help fix this? The key code seems to be here:
https://github.com/ShekarMudaliyar/social_share/blob/af83edb0fc6694836ababea51fcea322a72a5e02/ios/Classes/SocialSharePlugin.m#L299-L309
Maybe the code determines that the file does not exist? But why would that happen just for WA? There aren't any error logs associated with this.
I verified that WhatsApp won't accept both - this could be true for other messengers (e.g. Facebook seems to discard text if image is shared). I whipped up a quick "fix" for the situation: if the image path is specified in shareOptions
then I only send out the image, not the content. My commit, should it be useful for anyone is here.
If there is interest I can clean this up and split out e.g. shareOptionsText
and shareOptionsImage
to make things a bit cleaner.
I forked and the diff, should it be useful to anyone, is here: https://github.com/ShekarMudaliyar/social_share/compare/master...vejmelkam:master
I'm not even making this a PR.