[Bug]: (share_plus) iOS drops the subject when sharing a uri
维护者通常 1 天内回复
还没有人认领这个 Issue。
评估
- 难度
- 2/5
- 预计耗时
- 1-3 小时
- 新手友好度
- 82/100
- Issue 类型
- 缺陷
- 描述清晰度
- 描述清楚
- 活跃度
- 活跃
- 技术栈
- dart, ios, objective-c
- 领域
- mobile
调研方向
从 packages/share_plus/share_plus/ios/share_plus/Sources/share_plus/FPPSharePlusPlugin.m 开始,跟踪 shareUri: 路径,并将其与 shareText: 和 shareFiles: 进行比较。将已读取的 shareTitle 通过 shareUri: 传递给 share:withSubject:。完成标准是 iOS URI 分享在 Mail 中保留主题,同时保留丰富链接预览。
由索引模型根据 Issue 内容生成。
描述
Platform
iOS 15
Plugin
share_plus
Version
13.3.0
Flutter SDK
3.44.9
Steps to reproduce
- On an iOS device, share a
uriwith asubject(see the code sample). - Pick Mail in the share sheet.
- 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 onlyshareText:andshareFiles:receive it. shareUri:callsshare:withSubject:nil(L460-L472).share:withSubject:only skipsNSNull, so it sets the controller'ssubjecttonil(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 getsnil.
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
- 主要语言
- Dart
- 星标
- 1.9k
- 派生
- 1.3k
- 平均合并
- 6 天 16 小时
- 30 天内合并 PR
- 16
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
fluttercommunity/plus_plugins 的其他 Issue
-
难度 2/5 1-3 小时 新手友好度 78/100
fluttercommunity/plus_plugins#3943 ·
维护者通常 1 天内回复
-
[package_info_plus]: Use Flutter's compile-time build name/number on web instead of version.json未关闭
难度 2/5 1-3 小时 新手友好度 25/100
fluttercommunity/plus_plugins#3989 ·
维护者通常 1 天内回复
-
enhancement triage
难度 4/5 3-5 天 新手友好度 55/100
fluttercommunity/plus_plugins#3976 · 1 个 reaction ·
维护者通常 1 天内回复
-
难度 4/5 3-5 天 新手友好度 35/100
fluttercommunity/plus_plugins#3974 · 1 个 reaction ·
维护者通常 1 天内回复
-
enhancement triage
难度 5/5 一周以上 新手友好度 48/100
fluttercommunity/plus_plugins#3973 ·
维护者通常 1 天内回复
查看 fluttercommunity/plus_plugins 的全部 Issue
相似的 Issue
-
难度 2/5 1-3 小时 新手友好度 85/100
immich-app/immich#31955 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 72/100
-
Smart charging: USB charger re-assert is starved during BLE scans, so the tablet never discharges未关闭bug ready-for-agent
难度 2/5 1-3 小时 新手友好度 86/100
decentespresso/decaid#931 ·
维护者通常 1 天内回复
-
bug
难度 1/5 1 小时以内 新手友好度 92/100
flame-engine/flame#4067 ·
维护者通常 1 天内回复
-
bug
难度 2/5 1-3 小时 新手友好度 84/100
RunanywhereAI/runanywhere-sdks#982 · 1 条评论 ·
维护者通常 5 天内回复