Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug]: Share_Plus IOS not showing the text i try to share #2897

Closed
8 tasks done
Omario64 opened this issue May 2, 2024 · 5 comments
Closed
8 tasks done

[Bug]: Share_Plus IOS not showing the text i try to share #2897

Omario64 opened this issue May 2, 2024 · 5 comments
Labels
bug Something isn't working triage

Comments

@Omario64
Copy link

Omario64 commented May 2, 2024

Platform

IOS 17

Plugin

share_plus

Version

9.0.0

Flutter SDK

3.19.3

Steps to reproduce

await Share.shareXFiles([XFile(tempPath)], subject: subject, text: body);
and u will see before u even choose the app (Plain text and 1 document)
Skärmavbild 2024-05-02 kl  09 55 49

Code Sample

final url = Uri.parse(imgToDownload);
    final response = await http.get(url);
    final tempDir = await getTemporaryDirectory();
    final shareImagesDir = Directory('${tempDir.path}/shareImages');
    if (!await shareImagesDir.exists()) {
      await shareImagesDir.create(recursive: true);
    }
    final tempPath = '${shareImagesDir.path}/imageFromUrl.jpg';

    List<int> bytes = response.bodyBytes;
    await File(tempPath).writeAsBytes(bytes);
    await Share.shareXFiles([XFile(${shareImagesDir.path}/imageFromUrl.jpg)], subject: subject, text: body); //NOT WORKING

    Share.share('check out my website https://example.com'); //WORKING WELL I SEE MY TEXT

Logs

### Logs


na

Flutter Doctor

[✓] Flutter (Channel stable, 3.19.3, on macOS 14.4.1 23E224 darwin-arm64, locale sv-SE)
    • Flutter version 3.19.3 on channel stable at /Users/USER/FSDK/flutter
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision ba39319843 (8 weeks ago), 2024-03-07 15:22:21 -0600
    • Engine revision 2e4ba9c6fb
    • Dart version 3.3.1
    • DevTools version 2.31.1

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

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

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

[✓] Android Studio (version 2023.2)
    • 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.9+0-17.0.9b1087.7-11185874)

[✓] VS Code (version 1.88.1)
    • VS Code at /Applications/Visual Studio Code.app/Contents
    • Flutter extension version 3.88.0

[✓] Connected device (3 available)
    • iPhone 15 Pro Max (mobile) • XXXXXX-BE42-4932-BCD2-XXXXXX • ios            • com.apple.CoreSimulator.SimRuntime.iOS-17-4
      (simulator)
    • macOS (desktop)            • macos                                • darwin-arm64   • macOS 14.4.1 23E224 darwin-arm64
    • Chrome (web)               • chrome                               • web-javascript • Google Chrome 124.0.6367.118

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

• No issues found!

Checklist before submitting a bug

  • I searched issues in this repository and couldn't find such bug/problem
  • I Google'd a solution and I couldn't find it
  • I searched on StackOverflow for a solution and I couldn't find it
  • I read the README.md file of the plugin
  • I'm using the latest version of the plugin
  • All dependencies are up to date with flutter pub upgrade
  • I did a flutter clean
  • I tried running the example project
@Omario64 Omario64 added bug Something isn't working triage labels May 2, 2024
@miquelbeltran
Copy link
Member

It has been talked over and over again in this project that some apps don't support accepting text + images correctly.
You could have spent some time doing a bit of research and searching on the issues list.

As we mention in the README, this is not a package problem but a problem with those apps, and these types of issues will be closed.

Mobile platforms (Android and iOS)
Meta (WhatsApp, Instagram, Facebook Messenger) and similar apps

Due to restrictions set up by Meta/Facebook this plugin isn't capable of sharing data reliably to Facebook related apps on Android and iOS. This includes eg. sharing text to the Facebook Messenger. If you require this functionality please check the native Facebook Sharing SDK (https://developers.facebook.com/docs/sharing) or search for other Flutter plugins implementing this SDK. More information can be found in #413.

Other apps may also give problems when attempting to share content to them. We cannot warranty that a 3rd party app will properly implement the share functionality. Therefore, all bugs reported regarding compatibility with a specific app will be closed.

@Omario64
Copy link
Author

Omario64 commented May 6, 2024

@miquelbeltran I have spent time reading the README but there is no mention about the thing i face.
I DONT share to an app I just click on share button and don't choose an app, so the IOS built in share dialog what i'm talking about.
Skärmavbild 2024-05-06 kl  08 35 35

@miquelbeltran
Copy link
Member

the apps listed in the share sheet are decided by the OS, not the plugin

@Omario64
Copy link
Author

Omario64 commented May 6, 2024

the apps listed in the share sheet are decided by the OS, not the plugin

I know but i mean why i don't see the actual text instead of "plain text and 1 document"
Thanks

@miquelbeltran
Copy link
Member

miquelbeltran commented May 6, 2024

I believe it is because when sharing an image and a text, for UIActivityViewController is like sharing two data items, and will display that (text and 1 document).

You can try to provide only the subject, or only the text, to see if that makes a difference.

If you can modify the iOS code, you can try to modify the implementation of the plugin when it comes to providing data to UIActivityViewController, e.g. implementing the metadata provider as shown here: https://stackoverflow.com/a/58234878 The plugin doesn't support providing the metadata at the moment.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working triage
Projects
None yet
Development

No branches or pull requests

2 participants