plus_plugins icon indicating copy to clipboard operation
plus_plugins copied to clipboard

FIle Sharing on WhatsApp not able to send message with file

Open parmarravi opened this issue 3 years ago • 6 comments

I am using a latest version of share_plus: ^3.0.4 lib. When sending a pdf to email the text comes but when sending via WhatsApp only pdf comes and not the message.

How to send message and pdf both??

Device One plus 7T Android 30

final output = await getTemporaryDirectory();
    final file = File('${output.path}/example.pdf');
    await file.writeAsBytes(await pdf.save());

    Share.shareFiles(
      [file.path],
      text: 'check out this www.google.com',
      subject: 'Look what I found!',
    );

As per android document this is a fix

If you are previewing text, you can set a title, a thumbnail image, or both. Add a description to Intent.EXTRA_TITLE before calling Intent.createChooser(). Add a relevant thumbnail via ClipData.

parmarravi avatar Feb 14 '22 18:02 parmarravi

same problem

AlvaroVasconcelos avatar Feb 18 '22 21:02 AlvaroVasconcelos

Thanks for this report, this sadly is a known problem, but one which - at least to my knowledge - can't be fixed in the share_plus context. More information https://github.com/fluttercommunity/plus_plugins/issues/413 as a TLDR of the problem I can summarize the overall problem as follows: Some Facebook related apps - which WhatsApp belongs to - doesn't implement the Android system sharing regarding to the guidelines. Instead they have there own SDK (https://developers.facebook.com/docs/sharing/android/) which must be used for full sharing capabilities. There are some flutter packages which try to include this SDK, but as far as I heard those are outdated. There are further investigations ongoing. Right now there is no fix or workaround I could provide other than: Check other packages dedicated to this specific use case. I completely understand this is really unsatisfying, but sadly this is the situation.

Boehrsi avatar Feb 26 '22 14:02 Boehrsi

@Boehrsi subject not working when sharing raw url or files via WhatsApp. Separate shipping works.

AlvaroVasconcelos avatar May 18 '22 15:05 AlvaroVasconcelos

@AlvaroVasconcelos yes that's to my knowledge sadly how WhatsApp handles sharing data in that area, if the normal way of sharing via the Android system if used.

Boehrsi avatar May 18 '22 16:05 Boehrsi

Just published share_whatsapp last night for sending text message and or file directly into WhatsApp especially for Android.

alann-maulana avatar Jun 16 '22 02:06 alann-maulana

This happens on iOS as well, here only the text is uploaded to Whatsapp. If this is a limitation for Whatsapp, is there a way to selectively share what gets uploaded to what service? For example, if both text and paths are provided, only use paths for Whatsapp, but use both for the other services? Otherwise, using both text and paths is not useful because Whatsapp is so popular.

ydotmalik avatar Jul 13 '22 22:07 ydotmalik

This issue is stale because it has been open 60 days with no activity. Remove stale label or comment or this will be closed in 15 days

github-actions[bot] avatar Dec 28 '22 00:12 github-actions[bot]

Any updates on this?

speyso-support avatar Jan 13 '23 05:01 speyso-support