fix(share_plus): only configure popover presentation on iPad - #3965
Open
m1roxx wants to merge 1 commit into
Open
fix(share_plus): only configure popover presentation on iPad#3965m1roxx wants to merge 1 commit into
m1roxx wants to merge 1 commit into
Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Since Xcode 26,
UIActivityViewController.popoverPresentationControlleris non-nil on iPhone as well, where it returns a private_UIActivityViewControllerPresentationControllerinstead of a realUIPopoverPresentationController. Logged on iOS 26.0:FPPSharePlusPluginsetsourceViewunconditionally and, on iPhone with a non-emptysharePositionOrigin, also setsourceRectthrough theelse ifbranch. 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
sharePositionOrigin: share sheet presents as before andshare()resolves.flutter analyzereports 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
CHANGELOG.mdnor the plugin version inpubspec.yamlfiles.flutter analyze) does not report any problems on my PR.Breaking Change