Skip to content

fix(share_plus): only configure popover presentation on iPad - #3965

Open
m1roxx wants to merge 1 commit into
fluttercommunity:mainfrom
m1roxx:fix/share-plus-ipad-only-popover
Open

fix(share_plus): only configure popover presentation on iPad#3965
m1roxx wants to merge 1 commit into
fluttercommunity:mainfrom
m1roxx:fix/share-plus-ipad-only-popover

Conversation

@m1roxx

@m1roxx m1roxx commented Aug 27, 2026

Copy link
Copy Markdown

Description

Since Xcode 26, UIActivityViewController.popoverPresentationController is non-nil on iPhone as well, where it returns a private _UIActivityViewControllerPresentationController instead of a real UIPopoverPresentationController. Logged on iOS 26.0:

iPhone: isIpad=0  popover=<_UIActivityViewControllerPresentationController: 0x102715c50>
iPad:   isIpad=1  popover=<UIPopoverPresentationController: 0x1017486d0>

FPPSharePlusPlugin set sourceView unconditionally and, on iPhone with a non-empty sharePositionOrigin, also set sourceRect through the else if branch. Both configure anchored presentation on a controller that is not a popover controller on iPhone.

This PR restricts every popover configuration to iPad, which is what the surrounding comment already stated as the intent. iPad behaviour, including the centre-of-view fallback added in #3769, is unchanged.

Verification

  • iPhone 17 Pro / iOS 26.0, with and without sharePositionOrigin: share sheet presents as before and share() resolves.
  • iPad Pro 11-inch (M4) / iOS 26.0: popover anchors correctly, centre-of-view fallback still applies when no origin is given, no exception.
  • flutter analyze reports no issues.

I could not reproduce the hang described in #3943 on iOS 26.0 — 3/3 calls resolved, including a sub-screen round trip and an interrupted interactive dismissal. That report is against iOS 26.3–26.5.2, which needs a newer Xcode than I have available. So this change is verified non-regressive on both idioms, but confirmation that it resolves the hang itself needs someone running 26.3+.

Related Issues

Checklist

  • I read the Contributor Guide and followed the process outlined there for submitting PRs.
  • I titled the PR using Conventional Commits.
  • I did not modify the CHANGELOG.md nor the plugin version in pubspec.yaml files.
  • All existing and new tests are passing.
  • The analyzer (flutter analyze) does not report any problems on my PR.

Breaking Change

  • Yes, this is a breaking change.
  • No, this is not a breaking change.

Since Xcode 26, `UIActivityViewController.popoverPresentationController` is
non-nil on iPhone as well, where it returns a private
`_UIActivityViewControllerPresentationController` instead of a real
`UIPopoverPresentationController`.

The plugin set `sourceView` unconditionally and, on iPhone with a non-empty
`sharePositionOrigin`, also set `sourceRect`. Both configure anchored
presentation on a controller that is not a popover controller on iPhone.

Restrict every popover configuration to iPad, which is what the surrounding
comment already stated as the intent. iPad behaviour, including the
centre-of-view fallback added in fluttercommunity#3769, is unchanged.
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.

[share_plus] iOS: sourceView set unconditionally on iPhone — on iOS 26 swipe-dismissing the sheet can hang the share() Future and break touch delivery

1 participant