fix(share_plus): Avoid crash on iOS 26 on iPhones with no sharePositionOrigin #3699
+13
−6
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
After investigation of the issue with
share_pluscrashing apps on iPhones when nosharePositionOriginprovided and app is build with Xcode 26 I made an interesting discovery - when project is built with Xcode 26 hasPopoverPresentationController returnstrueboth for iPhones and for iPads, while in the same project, but built with Xcode 16.4 and older value istrueonly for iPads.Here is example app built with Xcode 16.4 running on iPhone:

Here is example app built with Xcode 26.0.1 running on iPhone:

Due to this difference plugin was throwing exception when no
sharePositionOriginwas provided causing multiple bug reports here.I have added an additional check for iPad which should solve the problem. With this change
sharePositionOriginis not required on iPhones as it was before.Related Issues
Closes #3645
Breaking Change
Does your PR require plugin users to manually update their apps to accommodate your change?
!in the title as explained in Conventional Commits).