plus_plugins icon indicating copy to clipboard operation
plus_plugins copied to clipboard

[Question]: Showing "Plain text and 1 Document" text in share bottomsheet in iOS.

Open vichuer opened this issue 1 year ago • 2 comments

What is your question?

I am using share_plus plugin to share an image and a text to whatsapp. But on the bottom sheet that pops up to select which app to share, The preview of the image is showing but the text is not showing instead "Plain text and 1 Document" is shown. Please refer the screenshot for better understanding.

share_plus_image1

Is there any way to change that and show custom text there?

This is how I am using the plugin :

Share.shareXFiles( [XFile(file!.path)], subject: 'I just got screened!', text: 'I just got screened!', ).then((value) { if (value.status == ShareResultStatus.success) { pop(context); } });

Checklist before submitting a question

  • [X] I searched issues in this repository and couldn't find such bug/problem
  • [X] I Google'd a solution and I couldn't find it
  • [X] I searched on StackOverflow for a solution and I couldn't find it
  • [X] I read the README.md file of the plugin
  • [X] I am using the latest version of the plugin
  • [X] All dependencies are up to date with flutter pub upgrade
  • [X] I did a flutter clean
  • [X] I tried running the example project

vichuer avatar Aug 02 '24 08:08 vichuer

I got the same issue too. Any solution for that one ?

KyawSoeW1n avatar Aug 07 '24 15:08 KyawSoeW1n

same here,but i think it's ios' bad. can't change this

kund3 avatar Oct 09 '24 08:10 kund3

I was having the same issue when trying to share a screenshot. Replacing the text field with subject fixed the issue for me.

Code:

String shareText = 'Check out my image!`;

await Share.shareXFiles(
  [XFile(imagePath.path)],
  subject: shareText
);

Share image: Screenshot 2024-11-20 at 12 05 44 PM

hunterramp avatar Nov 20 '24 20:11 hunterramp

Same issue for me.

RijazDev avatar Nov 28 '24 12:11 RijazDev

I was having the same issue when trying to share a screenshot. Replacing the text field with subject fixed the issue for me.

Code:

String shareText = 'Check out my image!`;

await Share.shareXFiles(
  [XFile(imagePath.path)],
  subject: shareText
);

Share image: Screenshot 2024-11-20 at 12 05 44 PM

I tried that and it solves the issue of showing the subject, but then when you share you do not have text. The image is shared without text. That forces the user to type their text once they select the social media. In my app I need to have a default text to share the link to my app.

Is there a way to have both subject and text?

fbernaly avatar Dec 31 '24 16:12 fbernaly

  • subject (which is going to be replaced by title) is in charge of showing the "title" of the share sheet.
  • text is part of the content shared.

So if you want to show some text in the share sheet AND share text, you need to provide the shared text in both the subject and text parameters.

miquelbeltran avatar Dec 31 '24 17:12 miquelbeltran

@miquelbeltran but using both removes the subject from being shown in the share sheet.

For example, the subject shows fine when I don't use text. After I use both, I see: Screenshot 2025-01-05 at 8 03 16 PM

dan-jacobson avatar Jan 06 '25 01:01 dan-jacobson

That's just how iOS handles it, the plugin can do nothing about that.

miquelbeltran avatar Jan 06 '25 07:01 miquelbeltran

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 Apr 07 '25 00:04 github-actions[bot]