Closed onguc closed 9 months ago
I attempted to share a content and link on Instagram, but encountered an error stating, "Can't send media - Try copying and sending the link instead."
Could someone assist me in sharing text and a link through the Instagram iOS app?
I attempted to share a content and link on Instagram, but encountered an error stating, "Can't send media - Try copying and sending the link instead."
Could someone assist me in sharing text and a link through the Instagram iOS app?
I've test with other dependencies but it didn’t work.
https://pub.dev/packages/social_share https://pub.dev/packages/share https://pub.dev/packages/share_plus https://pub.dev/packages/flutter_share_me
have you found the solution yet?
Bump! I need this as well. Not being able to share a single image to instagram is a bummer. I would love this to be made available! Thank you :)
Any update on this?
It is not a bug of plugin, but issue artificially created by Meta for their shitty apps.
i finally solved this issue .. Issue:
Instagram considers image and text caption as multiple images, preventing successful sharing due to an Instagram issue. The original _shareSheet function was designed to share an image with a text caption. To address the problem, it is recommended to modify the function as follows:
Original Function: _shareSheet(File file) async { try { await Share.shareXFiles([XFile(file.path)], text: "Mohamed El-Sayed"); } catch (error) { return; } }
Modified Function:
_shareSheet(File file) async { try { await Share.shareXFiles([XFile(file.path)], text: null); } catch (error) { return; } }
This change ensures that when sharing an image, no text is included, resolving the issue with Instagram's interpretation.
Additionally, there's a recommendation to update the usage of Share.shareFiles in the code. The original usage: Share.shareFiles( [imagePath], subject: product.productName ?? "", text: product.productUrl ?? "", sharePositionOrigin: positionOrigin(isIpad), ); Should be updated to:
Share.shareFiles( [imagePath], subject: null, text: null, sharePositionOrigin: positionOrigin(isIpad), );
This change aligns with the modified _shareSheet function, ensuring that no text is shared along with the image.
Please review and consider implementing these changes to address the Instagram sharing issue.
i finally solved this issue .. Issue:
Instagram considers image and text caption as multiple images, preventing successful sharing due to an Instagram issue. The original _shareSheet function was designed to share an image with a text caption. To address the problem, it is recommended to modify the function as follows:
Original Function: _shareSheet(File file) async { try { await Share.shareXFiles([XFile(file.path)], text: "Mohamed El-Sayed"); } catch (error) { return; } }
Modified Function:
_shareSheet(File file) async { try { await Share.shareXFiles([XFile(file.path)], text: null); } catch (error) { return; } }
This change ensures that when sharing an image, no text is included, resolving the issue with Instagram's interpretation.
Additionally, there's a recommendation to update the usage of Share.shareFiles in the code. The original usage: Share.shareFiles( [imagePath], subject: product.productName ?? "", text: product.productUrl ?? "", sharePositionOrigin: positionOrigin(isIpad), ); Should be updated to:
Share.shareFiles( [imagePath], subject: null, text: null, sharePositionOrigin: positionOrigin(isIpad), );
This change aligns with the modified _shareSheet function, ensuring that no text is shared along with the image.
Please review and consider implementing these changes to address the Instagram sharing issue.
You available for hire?
Platform
ipad 16.3
Plugin
share_plus
Version
7.0.2
Flutter SDK
3.7.12
Steps to reproduce
i get this error when i want to share to instagram on my ipad. (no problem on android)
I also want it to appear like below when posting on Instagram.
Does anyone have an idea? Thanks
Code Sample
Logs
Flutter Doctor
Checklist before submitting a bug
flutter pub upgrade
flutter clean