Hacktoberfest 2026: những issue maintainer đã đánh dấu cho tháng Mười, đang mở và phù hợp người mới. Xem issue Hacktoberfest

[Bug]: (share_plus) iOS drops the subject when sharing a uri

Đang mở Phù hợp với người mới
#3,994 1 bình luận 0 reaction 0 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 1 ngày

@kaluli123123 đang làm issue này rồi.

Từ ngày 4/10/2026.

  • #3997 của @kaluli123123 — đang mở

Đánh giá

Độ khó
2/5
Thời gian dự kiến
1-3 giờ
Mức phù hợp với người mới
82/100
Loại issue
Lỗi
Độ rõ ràng
Đặc tả rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
dart, ios, objective-c
Lĩnh vực
mobile

Hướng nghiên cứu

Bắt đầu trong packages/share_plus/share_plus/ios/share_plus/Sources/share_plus/FPPSharePlusPlugin.m, lần theo đường đi của shareUri: và so sánh với shareText: và shareFiles:. Truyền shareTitle đã được đọc qua shareUri: đến share:withSubject:. Hoàn tất khi việc chia sẻ URI trên iOS giữ nguyên chủ đề trong Mail đồng thời duy trì bản xem trước liên kết phong phú.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

bug triage
Platform

iOS 15

Plugin

share_plus

Version

13.3.0

Flutter SDK

3.44.9

Steps to reproduce
  1. On an iOS device, share a uri with a subject (see the code sample).
  2. Pick Mail in the share sheet.
  3. The Mail compose view opens with an empty subject line.

On Android the same call fills the subject, because Share.kt puts it in EXTRA_SUBJECT for a uri too. ShareParams.subject is documented as "Supported platforms: All".

This is not a duplicate of #3968, #347 or #691. Those are about the text path and Gmail. This is the uri path, where the subject never reaches the share sheet at all.

Cause

The uri branch of FPPSharePlusPlugin.m never reads the subject:

  • The subject is read into shareTitle (L294-L297), but only shareText: and shareFiles: receive it.
  • shareUri: calls share:withSubject:nil (L460-L472).
  • share:withSubject: only skips NSNull, so it sets the controller's subject to nil (L409-L411). The comment on that block says it is there to force the subject "when sharing a raw url or files", which is exactly the case that gets nil.

Suggested fix

Pass shareTitle into shareUri: and forward it to share:withSubject: instead of nil, as shareText: and shareFiles: already do. The item stays an NSURL, so the rich link preview is unaffected.

Code Sample
await SharePlus.instance.share(
  ShareParams(
    uri: Uri.parse('https://flutter.dev'),
    subject: 'Subject for Mail',
  ),
);
Logs
No error or exception. The share sheet and Mail open normally, only the subject is empty.
Flutter Doctor
[✓] Flutter (Channel stable, 3.44.9, on macOS 26.6.2 25G83 darwin-arm64, locale en-EE) [431ms]
    • Flutter version 3.44.9 on channel stable at /Users/**/.local/share/mise/http-tarballs/e5c14d6b5e917a8578327d2564ab78ece83cd685c74c29572ddaf7655f42205d
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision 6b182d2c75 (8 weeks ago), 2026-08-05 10:04:07 -0700
    • Engine revision 5a2a6a42cc
    • Dart version 3.12.2
    • DevTools version 2.57.0
    • Feature flags: enable-web, enable-linux-desktop, enable-macos-desktop, enable-windows-desktop, enable-android, enable-ios, cli-animations, enable-native-assets, no-enable-swift-package-manager,
      omit-legacy-version-file, enable-lldb-debugging, no-enable-uiscene-migration

[✓] Android toolchain - develop for Android devices (Android SDK version 37.0.0) [1,412ms]
    • Android SDK at /Users/**/Library/Android/sdk
    • Emulator version 36.1.9.0 (build_id 13823996) (CL:N/A)
    • Platform android-37.0, build-tools 37.0.0
    • ANDROID_HOME = /Users/**/Library/Android/sdk
    • Java binary at: /Applications/Android Studio.app/Contents/jbr/Contents/Home/bin/java
      This is the JDK bundled with the latest Android Studio installation on this machine.
      To manually set the JDK path, use: `flutter config --jdk-dir="path/to/jdk"`.
    • Java version OpenJDK Runtime Environment (build 21.0.9+-14787801-b1163.94)
    • All Android licenses accepted.

[✓] Xcode - develop for iOS and macOS (Xcode 26.6) [1,046ms]
    • Xcode at /Applications/Xcode-26.6.0.app/Contents/Developer
    • Build 17F113
    • CocoaPods version 1.17.0

[✓] Chrome - develop for the web [5ms]
    • Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome
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
Ngôn ngữ chính
Dart
Star
1.9k
Fork
1.3k
Merge trung bình
4 ngày 2 giờ
Pull request đã merge (30 ngày)
15

Chuẩn bị môi trường

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của fluttercommunity/plus_plugins

Tất cả issue của fluttercommunity/plus_plugins

Issue tương tự

Thêm issue về Dart

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.