fluttercommunity / plus_plugins

Flutter Community Plus Plugins
BSD 3-Clause "New" or "Revised" License
1.55k stars 927 forks source link

[share_plus] Unable to share an image and a text through WhatsApp/Slack with Share.shareFiles (other socials apps work fine) #385

Closed BLKKKBVSIK closed 1 year ago

BLKKKBVSIK commented 3 years ago

System info

Issue occurs on: iOS Plugin name: share_plus Plugin version: 2.1.4 Flutter doctor output:

Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel stable, 2.2.3, on macOS 11.4 20F71 darwin-arm, locale en-GB)
[✓] Android toolchain - develop for Android devices (Android SDK version 30.0.3)
[✓] Xcode - develop for iOS and macOS
[✓] Chrome - develop for the web
[✓] Android Studio (version 4.1)
[✓] VS Code (version 1.58.2)
[✓] Connected device (5 available)

• No issues found!

Steps to Reproduce

  1. Import the share_plus package
  2. Create a GestureDetector/Button that makes a call to the Share.shareFiles method like so:
    await Share.shareFiles(
      [_PngFile!.path],
       text: "This is a text"
    );
  3. Share it with WhatsApp or Slack.

The image will not be forward on WhatsApp or Slack on iOS if there is the text attribute.

Logs

[✓] Flutter (Channel stable, 2.2.3, on macOS 11.4 20F71 darwin-arm, locale en-GB)
    • Flutter version 2.2.3 at /Users/blkkkbvsik/Documents/flutterSDK
    • Framework revision f4abaa0735 (4 weeks ago), 2021-07-01 12:46:11 -0700
    • Engine revision 241c87ad80
    • Dart version 2.13.4

[✓] Android toolchain - develop for Android devices (Android SDK version 30.0.3)
    • Android SDK at /Users/blkkkbvsik/Library/Android/sdk
    • Platform android-30, build-tools 30.0.3
    • Java binary at: /Applications/Android
      Studio.app/Contents/jre/jdk/Contents/Home/bin/java
    • Java version OpenJDK Runtime Environment (build
      1.8.0_242-release-1644-b3-6915495)
    • All Android licenses accepted.

[✓] Xcode - develop for iOS and macOS
    • Xcode at /Applications/Xcode.app/Contents/Developer
    • Xcode 12.5.1, Build version 12E507
    • CocoaPods version 1.10.1

[✓] Chrome - develop for the web
    • Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome

[✓] Android Studio (version 4.1)
    • Android Studio at /Applications/Android Studio.app/Contents
    • Flutter plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/9212-flutter
    • Dart plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/6351-dart
    • Java version OpenJDK Runtime Environment (build
      1.8.0_242-release-1644-b3-6915495)

[✓] VS Code (version 1.58.2)
    • VS Code at /Applications/Visual Studio Code.app/Contents
    • Flutter extension version 3.24.0

[✓] Connected device (5 available)
    • Pixel 3 XL (mobile)    • 893Y03PH6                            • android-arm64
      • Android 11 (API 30)
    • Enzo’s iPhone (mobile) • 00008101-000914441438001E            • ios
      • iOS 14.6
    • iPhone 8 (mobile)      • A6D20994-B42C-461C-B55F-1AE61D914285 • ios
      • com.apple.CoreSimulator.SimRuntime.iOS-14-5 (simulator)
    • macOS (desktop)        • macos                                • darwin-arm64
      • macOS 11.4 20F71 darwin-arm
    • Chrome (web)           • chrome                               • web-javascript
      • Google Chrome 92.0.4515.107

• No issues found!
pruthvi-itribe commented 2 years ago

have the same issue, after long time figured out that it was working in other apps like gmail. But doesn't work on whatsapp and slack

pdax-king commented 2 years ago

I'm encountering this problem as well. Slack and Linked-in.

This issue exists only in iOS.

pruthvi-itribe commented 2 years ago

in IOS, we are able to send either image or text in some of the apps like whatsapp or slack. Both of them then text is given more priority in these apps

MatheusLimaN commented 2 years ago

I have the same issue only in iOS

BLKKKBVSIK commented 2 years ago

in IOS, we are able to send either image or text in some of the apps like WhatsApp or slack. Both of them then text is given more priority in these apps

@pruthvi-itribe Is it an iOS technical limitation ? Or is it a WhatsApp/Slack restriction on iOS? 🧐 Seems like share_plus is working correctly then, but I'll maybe do a PR, to tell that on iOS the priority is given to the text priority.

MatheusLimaN commented 2 years ago

in IOS, we are able to send either image or text in some of the apps like WhatsApp or slack. Both of them then text is given more priority in these apps

@pruthvi-itribe Is it an iOS technical limitation ? Or is it a WhatsApp/Slack restriction on iOS? 🧐 Seems like share_plus is working correctly then, but I'll maybe do a PR, to tell that on iOS the priority is given to the text priority.

But when only the image is sent without the text, we have the same behavior

pruthvi-itribe commented 2 years ago

I think its limitation of whatsapp and slack on IOS not allowing both simultaneously. Because if you use the same share_plus library and send to gmail app, both text and image are composed in an email.

I have seen some other apps also which has similar way of sharing image or text to whatsapp which are native applications on IOS

pruthvi-itribe commented 2 years ago

in IOS, we are able to send either image or text in some of the apps like WhatsApp or slack. Both of them then text is given more priority in these apps

@pruthvi-itribe Is it an iOS technical limitation ? Or is it a WhatsApp/Slack restriction on iOS? 🧐 Seems like share_plus is working correctly then, but I'll maybe do a PR, to tell that on iOS the priority is given to the text priority.

But when only the image is sent without the text, we have the same behavior

Do you mean it doesn't share image then ?

MatheusLimaN commented 2 years ago

in IOS, we are able to send either image or text in some of the apps like WhatsApp or slack. Both of them then text is given more priority in these apps

@pruthvi-itribe Is it an iOS technical limitation ? Or is it a WhatsApp/Slack restriction on iOS? 🧐 Seems like share_plus is working correctly then, but I'll maybe do a PR, to tell that on iOS the priority is given to the text priority.

But when only the image is sent without the text, we have the same behavior

Do you mean it doesn't share image then ?

Sorry, I did the test again and without the text the image is normally shared 😅

pablo-johnson commented 2 years ago

Hi

I have the same issue only on iOS.

I will add some comments only to clarify the issue.

When sharing a text in the text parameter and an image on Whatsapp or Slack, only the text is shared, not the image. When sharing a text in the subject parameter and an image on Whatsapp or Slack, only the image is shared in whatsapp and not in Slack. When sharing only an image (no text in any parameter) on Whatsapp or Slack, the image is shared only in Whatsapp and not in Slack.

So, this makes it impossible to share a text + an image on the iOS platform on Whatsapp. And makes it also impossible to share an image on the iOS platform on Slack.

Bonus info: It is possible to share an image from the gallery app to Slack. So i think this makes it clear that slack is not the problem...

Some logs when trying to share to Slack [NSExtension] Extension request contains input items but the extension point does not specify a set of allowed payload classes. The extension point's NSExtensionContext subclass must implement+_allowedItemPayloadClasses. This must return the set of allowed NSExtensionItem payload classes. In future, this request will fail with an error. Extension: <EXConcreteExtension: 0x280910840> {id = com.tinyspeck.chatlyio.share} Items: ( "<NSExtensionItem: 0x283e129d0> - userInfo: {\n NSExtensionItemAttachmentsKey = (\n \"<NSItemProvider: 0x2817113b0> {types = (\\n \\\"public.image\\\"\\n)}\",\n \"<NSItemProvider: 0x281711340> {types = (\\n \\\"public.plain-text\\\"\\n)}\"\n );\n NSExtensionItemAttributedContentTextKey = {length = 144, bytes = 0x7b5c7274 66315c61 6e73695c 616e7369 ... 74626c3b 3b7d0a7d };\n \"com.apple.UIKit.NSExtensionItemUserInfoIsContentManagedKey\" = 0;\n}" )

Any idea?

github-actions[bot] commented 2 years ago

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

zuzi-m commented 2 years ago

Any updates on this? So is this a technical limitation of the apps we are sharing into (e.g. WhatsApp not being able to handle text and images at the same time) or a limitation inside the share_plus plugin (e.g. a bug in the plugin)?

reijerteunis commented 2 years ago

It would be great if this can be fixed. I have the same issue for my app.

boring-km commented 2 years ago

I've implemented it in Swift instead.

https://github.com/boring-km/color-from-image/commit/577f9df2267389ae4370e2c70d316f4b520acd4d

jagmohanJelly commented 2 years ago

@boring-km as i have seen your code you have implemented a native channel for IOS only but there also you are only sharing the image not text and image together please show how to share text and image together

boring-km commented 2 years ago

@jagmohanJelly here you are. https://github.com/boring-km/color-from-image/commit/6e4aabdde633ea20b8db1c8f781d528e5d548539

wilson-christian commented 2 years ago

Facing the similar issue, while just sending image not even text.

github-actions[bot] commented 1 year ago

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

pablo-johnson commented 1 year ago

why is this closed as not planned??