[Question] [share_plus]: Unable to share image with proper title
What is your question?
Hello, I am trying to figure out how to share an image from my application along with a title to be displayed. I am attempting to get this to work on iOS first, and have not tested on Android yet. I understand via scraping around the internet that there are limitations with sharing to some apps, particularly meta-developed ones. However, to me there definitely appear to be issues with the plugin itself.
For the purpose of this inquiry, I will be testing on the plugin example itself, to ensure all issues have to do with the functionality of the plugin and not my own app.
For starters, I just need to be able to display a title, along with the image preview within the iOS share sheet. Of course, right now any 'text' or 'subject' parameters will not be displayed along with the image preview, and it will instead display 'Plain Text and 1 Document'.
Other scenarios:
- Only 'text' shared: displays the text properly in title area (with flutter logo placeholder)
- 'Text' and 'subject' shared: displays the subject for some reason instead of the text. From the documentation I though the subject was specifically for email sharing. (with flutter logo placeholder)
- 'Only image shared: displays 'Plain Text and 1 Document' even though no text was provided. However, I think this issue is specific to the example which probably provides an empty string, as when I do not specify the 'text' and 'subject' parameters in my own app it displays 'PNG • 1.6 MB'
Along with the issues relating to the share sheet, sharing itself seems to be less than intuitive. I will test this on a few basic social apps that should provide a decent look at what's going on
Text with image shared:
- Messages: displays the text and image, but the text is located above the image, not below it as would be expected
- Gmail: displays the text and image with the text located below the image, again being in the opposite order that would be optimal for the email medium. Text is also copied to the subject line, and the subject line is ignored even if the parameter is provided and no text is provided
- Instagram: only provides option to share as reel which is not useful for sharing a png image
- X: No issue
Image with no text shared:
- Messages: No issue
- Gmail: No issue
- Instagram: No issue -- provides proper options to share including post, story, and message
- X: No plugin issue -- adds some whitespace above and below my png image, but I reckon that is done by X platform to conform to their own image requirements
So, aside from small matters like the ability to position the text optimally, and gmail ignoring the subject parameter, the real issue is just displaying a proper title in the share sheet, and ensuring the 'Plain Text' is not also passed to apps that do not want it, like Instagram. It seems to me there should be a separate parameter to specify the title, and inclusion of the abilty to customize what data is passed based on the share target. I suppose this may not be possible with the current iteration of the share sheet, I am no expert.
At the very least, I need to be able to share an image with a title so that it doesn't display ugly 'Plain Text and 1 Document'.
I have found that this is definitely possible while an AI image generation app called 'Dream', and I've recorded that to show. It seems they are able to add a title and still share their image properly to instagram.
I also tested on Duolingo, which has their own custom share view, but also allows users to use the iOS share sheet. It works for them too, with title, image, text, link. They've even used their app icon as the preview image for the share which looks even more professional. I'll include a video of this as well.
To put a point on my question, it certainly seems to be possible to develop a professional sharing functionality. If the consensus is that this plugin is doing the most it can due to limitations outside its control, what specifically are those limitations and why are these other apps able to figure it out?
I am going to, of course, continue to delve into this matter. I sure hope I'm not being an ass and am just using the plugin incorrectly, but since the example has the same issue with ugly non-title I was compelled to ask for guidance. I will update with any relevant findings.
Dream: https://github.com/fluttercommunity/plus_plugins/assets/141113522/e28397b2-fbdc-4758-a4fd-506c18bb2ac1
Duolingo https://github.com/fluttercommunity/plus_plugins/assets/141113522/edd5a1ed-2fde-471d-935f-21a587704106
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
How about this error? How to solve?