JayTWWM / Share-Files-And-Screenshot-Widgets-Flutter

This pub lets you share any kind of files (csv, mp4, png etc), take screenshot of the widgets you want and return as Image and share them directly as well in the form of an image.
Other
24 stars 14 forks source link

Whatsapp share doesnt share the image #5

Closed mstolk closed 3 years ago

mstolk commented 4 years ago

Hi,

When choosing the option to share to a whatsapp contact the screenshot is not shared, only the caption. Any other option (like facebook or email) do share the screenshot. What can be the issue here?

Marco

JayTWWM commented 4 years ago

Can you show me your sharing code?

mstolk commented 4 years ago

Hi thanks for responding, i'm calling the line ShareFilesAndScreenshotWidgets().shareScreenshot( .... on pressing a RaisedButton. The button is on a bottomNavigationBar from a Scaffold. The previewContainer is within a RepaintBoundary and a Center tag.

If i have some time i will create a testproject with only this code. Strange thing is that from the same button the sharing with an email does work but only the whatsapp option doesnt attach the screenshot.

JayTWWM commented 4 years ago

Can you confirm that you're using the right mimetype?

mstolk commented 4 years ago

My mimetype is on "image/png" .... is that correct?

image

JayTWWM commented 4 years ago

If it is working for other share options then it should be some other problem not related to the pub......... I have tested it the same way as you've done it and it worked for me.

stefanonucida commented 3 years ago

I have the same problem. Only in iOS

stefanonucida commented 3 years ago

I've found this workaround from: https://stackoverflow.com/questions/55685641/share-image-and-text-together-on-whatsapp-in-swift.

onPressed: () { ShareFilesAndScreenshotWidgets().shareScreenshot( _previewContainer, 800, "TITLE", "FILENAME", "MIME", text: Platform.isIOS ? "" : "TEXT"); })

Please note that request for save image cause brutal crash on iOS: you need to insert int info.plist:

<key>NSPhotoLibraryAddUsageDescription</key>
<string>$(FLUTTER_BUILD_NAME)</string>
JayTWWM commented 3 years ago

You need to insert int info.plist:

<key>NSPhotoLibraryAddUsageDescription</key> <string>$(FLUTTER_BUILD_NAME)</string>

DeepashreeBallodi commented 3 years ago

I've found this workaround from: https://stackoverflow.com/questions/55685641/share-image-and-text-together-on-whatsapp-in-swift.

onPressed: () { ShareFilesAndScreenshotWidgets().shareScreenshot( _previewContainer, 800, "TITLE", "FILENAME", "MIME", text: Platform.isIOS ? "" : "TEXT"); })

Please note that request for save image cause brutal crash on iOS: you need to insert int info.plist:

<key>NSPhotoLibraryAddUsageDescription</key>
<string>$(FLUTTER_BUILD_NAME)</string>

But I need to share With Text also in iOS. How can I do?

JayTWWM commented 3 years ago

It is written in the documentation