plus_plugins
plus_plugins copied to clipboard
FIle Sharing on WhatsApp not able to send message with file
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.
same problem
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 subject not working when sharing raw url or files via WhatsApp. Separate shipping works.
@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.
Just published share_whatsapp last night for sending text message and or file directly into WhatsApp especially for Android.
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.
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
Any updates on this?