Skip to content

fix(share_plus): Fix 'share text' not showing when share files#907

Merged
miquelbeltran merged 6 commits into
fluttercommunity:mainfrom
onestudio-co:Fix-share-text-with-image
Jun 27, 2022
Merged

fix(share_plus): Fix 'share text' not showing when share files#907
miquelbeltran merged 6 commits into
fluttercommunity:mainfrom
onestudio-co:Fix-share-text-with-image

Conversation

@salahamassi
Copy link
Copy Markdown
Contributor

@salahamassi salahamassi commented Jun 13, 2022

Description

when the user uses shareFiles or shareWithResult methods to share a file or files,
text argument was ignored and not added to share:items on the IOS platform, so I just add the text to share:items .

Related Issues

*no related issues

Checklist

  • I read the [Contributor Guide] and followed the process outlined there for submitting PRs.
  • My PR includes unit or integration tests for all changed/updated/fixed behaviors (See [Contributor Guide]).
  • All existing and new tests are passing.
  • I updated the version in pubspec.yaml and CHANGELOG.md.
  • I updated/added relevant documentation (doc comments with ///).
  • The analyzer (flutter analyze) does not report any problems on my PR.
  • I read and followed the [Flutter Style Guide].
  • I am willing to follow-up on review comments in a timely manner.

Breaking Change

Does your PR require plugin users to manually update their apps to accommodate your change?

  • Yes, this is a breaking change (please indicate a breaking change in CHANGELOG.md and increment major revision).
  • No, this is not a breaking change.

Comment thread packages/share_plus/share_plus/ios/Classes/FLTSharePlusPlugin.m
@miquelbeltran
Copy link
Copy Markdown
Member

I've been testing this, and I have no problem approving and merging, but I fail to see what problem is it solving.

When I test this PR example against multiple apps: Telegram, Google Keep, Twitter, etc. sharing both images and text, only the image gets shared.

I am unable to see if this is a limitation with share_plus or a general problem with all apps, and I am not sure if this PR attempts to fix this problem or something else.

@salahamassi
Copy link
Copy Markdown
Contributor Author

salahamassi commented Jun 24, 2022

I've been testing this, and I have no problem approving and merging, but I fail to see what problem is it solving.

When I test this PR example against multiple apps: Telegram, Google Keep, Twitter, etc. sharing both images and text, only the image gets shared.

I am unable to see if this is a limitation with share_plus or a general problem with all apps, and I am not sure if this PR attempts to fix this problem or something else.

I attached two videos to show the difference before and after this PR when I try to share a text with an image through the Email or Twitter apps.

These videos are captured from my iPhone 12 ios 15.5

before video

before.480.mp4

after video

after.480.mp4

The code added to this PR code adds the share text to share:items array.

some apps like Twitter, email, or telegram app will display the share text with an image, and some apps will not read the text just the image like the Facebook app (the Facebook app will read just hashtag text like #salah I don't know why 😐), and WhatsApp app will just read the text and will ignore the image.

I believe each app will handle the share items in its custom way.

but of course, we need to add the share text to share:items array so the apps can know there is the text along with the shared image.

@miquelbeltran
Copy link
Copy Markdown
Member

Thanks for the videos! Something was wrong when I tested this then, because I couldn't see the shared text on Twitter, but I see that it works on your case

@miquelbeltran miquelbeltran merged commit 19bd1c2 into fluttercommunity:main Jun 27, 2022
@miquelbeltran
Copy link
Copy Markdown
Member

We forgot to update the pubspec.yml before merging, I will fix that on main directly

@miquelbeltran
Copy link
Copy Markdown
Member

4.0.10 published now

@salahamassi salahamassi deleted the Fix-share-text-with-image branch July 3, 2022 06:28
@github-actions github-actions Bot locked as resolved and limited conversation to collaborators Feb 1, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants