fluttercommunity / plus_plugins

Flutter Community Plus Plugins
BSD 3-Clause "New" or "Revised" License
1.62k stars 976 forks source link

[Bug]: Can share to instagram stories from IOS #2466

Closed ronbadur closed 10 months ago

ronbadur commented 11 months ago

Platform

IOS

Plugin

share_plus

Version

7.2.1

Flutter SDK

3.16.2

Steps to reproduce

Try to share file to instagram stories from IOS and I am getting a black screen, without any error message. share to reels and regular posts worked.

On andorid I can share to all kind of content in instagram including stories.

Code Sample

await Share.shareXFiles([new XFile(file.path)]);

Logs

no error logs

Flutter Doctor

[✓] Flutter (Channel stable, 3.16.2, on macOS 14.1.1 23B81 darwin-arm64, locale en-IL)
    • Flutter version 3.16.2 on channel stable at /Users/ronbadur/dev/flutter
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision 9e1c857886 (3 weeks ago), 2023-11-30 11:51:18 -0600
    • Engine revision cf7a9d0800
    • Dart version 3.2.2
    • DevTools version 2.28.3

[✓] Android toolchain - develop for Android devices (Android SDK version 34.0.0)
    • Android SDK at /Users/ronbadur/Library/Android/sdk
    • Platform android-34, build-tools 34.0.0
    • ANDROID_HOME = /Users/ronbadur/Library/Android/sdk
    • Java binary at: /Applications/Android Studio.app/Contents/jbr/Contents/Home/bin/java
    • Java version OpenJDK Runtime Environment (build 17.0.6+0-17.0.6b829.9-10027231)
    • All Android licenses accepted.

[✓] Xcode - develop for iOS and macOS (Xcode 15.0.1)
    • Xcode at /Applications/Xcode.app/Contents/Developer
    • Build 15A507
    • CocoaPods version 1.14.3

[✓] Chrome - develop for the web
    • Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome

[✓] Android Studio (version 2022.3)
    • Android Studio at /Applications/Android Studio.app/Contents
    • Flutter plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/9212-flutter
    • Dart plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/6351-dart
    • Java version OpenJDK Runtime Environment (build 17.0.6+0-17.0.6b829.9-10027231)

[✓] VS Code (version 1.64.2)
    • VS Code at /Users/ronbadur/Downloads/Visual Studio Code.app/Contents
    • Flutter extension can be installed from:
      🔨 https://marketplace.visualstudio.com/items?itemName=Dart-Code.flutter

[✓] Connected device (4 available)
    • Bar’s iPhone (mobile) • 00008110-001869663498401E            • ios            • iOS 17.1.2 21B101
    • iPhone 14 (mobile)    • A7DEC444-F9AD-439E-9CB2-029DBCD21B32 • ios            • com.apple.CoreSimulator.SimRuntime.iOS-16-4 (simulator)
    • macOS (desktop)       • macos                                • darwin-arm64   • macOS 14.1.1 23B81 darwin-arm64
    • Chrome (web)          • chrome                               • web-javascript • Google Chrome 120.0.6099.109

[✓] Network resources
    • All expected network resources are available.

• No issues found!

Checklist before submitting a bug

itsJonibek commented 10 months ago

Facing the same problem about two weeks or more

mohmedelsayed commented 10 months ago

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;
}
}
vbuberen commented 10 months ago

Please read documentation or at least README file before filling bugs. Especially if you mark the checkmark that you have read README in the bug report template like you did here.

It is explained that Meta's apps are not supported properly, so it is not an issue of a package.

ivoscosta commented 9 months ago

The solution of @mohmedelsayed didn't work for me. I'm still having a black screen only when share in Instagram Stories. I already read the docs and is everything right. I noticed that this same error happens when I try to share a photo from the gallery. So I believe the error is with the Instagram app.

ambrosiora commented 9 months ago

The solution of @mohmedelsayed didn't work for me. I'm still having a black screen only when share in Instagram Stories. I already read the docs and is everything right. I noticed that this same error happens when I try to share a photo from the gallery. So I believe the error is with the Instagram app.

Hello I already read all the docs and README too, did everything as said and still having this issue. I'm wondering, have you been getting good results since you reported the problem? Additionally, when you tried to share some photo from the gallery, this error still happening?

I updated the instagram app and the error is gone.

mohmedelsayed commented 9 months ago

The solution of @mohmedelsayed didn't work for me. I'm still having a black screen only when share in Instagram Stories. I already read the docs and is everything right. I noticed that this same error happens when I try to share a photo from the gallery. So I believe the error is with the Instagram app.

Hello I already read all the docs and README too, did everything as said and still having this issue. I'm wondering, have you been getting good results since you reported the problem? Additionally, when you tried to share some photo from the gallery, this error still happening?

I updated the instagram app and the error is gone. yes after update worked for me thanks