[Question]: Showing "Plain text and 1 Document" text in share bottomsheet in iOS.
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.
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
I got the same issue too. Any solution for that one ?
same here,but i think it's ios' bad. can't change this
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:
Same issue for me.
I was having the same issue when trying to share a screenshot. Replacing the
textfield withsubjectfixed the issue for me.Code:
String shareText = 'Check out my image!`; await Share.shareXFiles( [XFile(imagePath.path)], subject: shareText );Share image:
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?
subject(which is going to be replaced bytitle) is in charge of showing the "title" of the share sheet.textis 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 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:
That's just how iOS handles it, the plugin can do nothing about that.
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
