Skip to content

fix(share_plus): Avoid crash on iOS 26 on iPhones with no sharePositionOrigin#3699

Merged
vbuberen merged 2 commits intomainfrom
fix/ios_26_share_position
Oct 19, 2025
Merged

fix(share_plus): Avoid crash on iOS 26 on iPhones with no sharePositionOrigin#3699
vbuberen merged 2 commits intomainfrom
fix/ios_26_share_position

Conversation

@vbuberen
Copy link
Copy Markdown
Collaborator

Description

After investigation of the issue with share_plus crashing apps on iPhones when no sharePositionOrigin provided and app is build with Xcode 26 I made an interesting discovery - when project is built with Xcode 26 hasPopoverPresentationController returns true both for iPhones and for iPads, while in the same project, but built with Xcode 16.4 and older value is true only for iPads.

Here is example app built with Xcode 16.4 running on iPhone:
Screenshot 2025-10-19 at 22 56 16

Here is example app built with Xcode 26.0.1 running on iPhone:
Screenshot 2025-10-19 at 22 53 42

Due to this difference plugin was throwing exception when no sharePositionOrigin was provided causing multiple bug reports here.

I have added an additional check for iPad which should solve the problem. With this change sharePositionOrigin is 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?

  • Yes, this is a breaking change (please indicate that with a ! in the title as explained in Conventional Commits).
  • No, this is not a breaking change.

@vbuberen vbuberen added the share_plus Feature, Enhancement, Bug Fixes for Share Plus Plugin label Oct 19, 2025
@vbuberen vbuberen merged commit 42b079b into main Oct 19, 2025
19 of 21 checks passed
@vbuberen vbuberen deleted the fix/ios_26_share_position branch October 19, 2025 20:40
taipham-elfie pushed a commit to elfiehub/plus_plugins that referenced this pull request Oct 21, 2025
taipham-elfie pushed a commit to elfiehub/plus_plugins that referenced this pull request Oct 21, 2025
@lucasuracosta
Copy link
Copy Markdown

Fellow devs remember:
If you're updating to the version 12.0.1 that has this fix but it seems "it's not working for you", do first flutter clean and then do flutter pub get so you truly get this last version.

(It happened to me, so leaving it here as a help!)

@sjmamani
Copy link
Copy Markdown

This error recently reappeared in my app's logs, with the notable exception that the device in question is an iPad. Could it be that this error is occurring only on that device? I haven't had any issues on the iPhone since I updated the package to version 12.0.1.

iPad (9th generation) with iPadOS 26.4.1
share_plus v12.0.1

Non-fatal Exception: FlutterError
PlatformException(error, sharePositionOrigin: argument must be set, {{0, 0}, {0, 0}} must be non-zero and within coordinate space of source view: {{0, 0}, {1080, 810}}, null, null).

@vbuberen
Copy link
Copy Markdown
Collaborator Author

This error recently reappeared in my app's logs, with the notable exception that the device in question is an iPad.

Please read the README of the package. iPads need sharePositionOrigin as of today.

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

Labels

share_plus Feature, Enhancement, Bug Fixes for Share Plus Plugin

Projects

None yet

3 participants