Skip to content

fix(share_plus): preserve the subject when sharing a URI on iOS - #3997

Draft
kaluli123123 wants to merge 2 commits into
fluttercommunity:mainfrom
kaluli123123:fix/share-plus-uri-subject-3994
Draft

kaluli123123 wants to merge 2 commits into
fluttercommunity:mainfrom
kaluli123123:fix/share-plus-uri-subject-3994

Conversation

@kaluli123123

Copy link
Copy Markdown

Description

Preserve the existing share title/legacy subject when sharing a URI on iOS. The URI branch previously passed nil to the activity controller while the text and file branches forwarded the value. The NSURL share item and existing completion, excluded-activity and popover behavior are unchanged.

Added native XCTest coverage through plugin registration and a binary MethodChannel message. The tests inspect a real UIActivityViewController for the supplied subject, title precedence, and omitted subject. On unchanged production code they report 1 pass and 2 failures; with the fix all 3 pass on an iPhone 17 Pro simulator, iOS 26.5, arm64. The package's Dart tests pass 14 with 1 existing skip, analysis reports no issues, Swift strict formatting and formatting of the modified Objective-C regions pass. Independent read-only review found no blocking issues.

The Xcode 27 verification command uses ARCHS=arm64, deployment target 15 and an isolated test bundle id; these command-line overrides address the unchanged example's baseline build limitations. The published iOS 13 minimum is unchanged. Mail compose UI, physical devices, iPad rendering, iOS 13 runtime and the full cross-platform CI matrix remain unverified. The tests prove controller configuration, not email delivery.

Codex assisted implementation, tests and independent review. The GitHub-verified signed delivery tree matches the locally tested tree; this draft remains pending contributor and platform-maintainer review.

Related Issues

Checklist

  • I read the Contributor Guide and followed the package-specific process.
  • I titled the PR using Conventional Commits.
  • I did not modify CHANGELOG.md or plugin version files.
  • All existing and new tests are passing. (The complete cross-platform matrix is not claimed; actual local results are above.)
  • The package analyzer reports no problems.

Breaking Change

  • Yes.
  • No. No public API changes.

Forward the existing share title or legacy subject into the URI share controller. Keep raw NSURL items, completion behavior, and iPad presentation unchanged. Cover subject, title precedence, and no subject through the native registered channel.

Closes fluttercommunity#3994

Co-authored-by: Codex <noreply@openai.com>
@kaluli123123

Copy link
Copy Markdown
Author

The repository-wide analyzer failure is also present on the unchanged base commit 53e5ecf38c8775af21c62c2932d07f88bad1a3b2e08064d336.

  • This PR's analyzer job reports 19 LocalPlatform/FakePlatform deprecation diagnostics in android_intent_plus and one in its example.
  • The base branch's analyzer job reports the same diagnostics in those unchanged packages.
  • share_plus, share_plus_platform_interface, and share_plus_example report no analyzer issues in both runs. The share-specific build and integration jobs passed in this PR.

This PR remains a draft pending maintainer review; it does not change the unrelated analyzer diagnostics.

@kaluli123123

Copy link
Copy Markdown
Author

Merged upstream main 907994b in c909695. Upstream #4000 replaces the deprecated platform APIs in android_intent_plus, which caused this PR's repository-wide analyzer failure. The upstream analyzer already passes: https://github.com/fluttercommunity/plus_plugins/actions/runs/37761330438/job/113258178842.

The PR diff against main still contains only the original two share_plus iOS source/test files. This update adds no separate plugin changes or check suppressions.

Local validation with Flutter 3.47.0 / Dart 3.13.0:

  • All 25 workspace packages pass dart analyze . --fatal-infos through Melos.
  • share_plus: 14 tests passed, 1 skipped.
  • share_plus_platform_interface: 7 tests passed.
  • android_intent_plus: 20 tests passed.
  • Diff whitespace check passed.

The first analyzer attempt encountered a local analytics TLS failure in an unrelated example package. Re-running with the documented process-only DASH__SUPPRESS_ANALYTICS=true setting passed without code changes. Native platform builds and device tests were not repeated locally in this update. Current-head CI remains separate from these local results, and the PR remains a draft.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

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

1 participant