[share_plus] iOS: sourceView set unconditionally on iPhone — on iOS 26 swipe-dismissing the sheet can hang the share() Future and break touch delivery
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 78/100
- Issue type
- Bug
- Clarity
- Clearly specified
- Activity status
- Quiet
- Tech stack
- dart, ios, objective-c
- Domain
- mobile-dev
Research direction
Start in FPPSharePlusPlugin.m at the UIActivityViewController popover configuration and compare the reported iPhone and iPad behavior. Reproduce the swipe dismissal on iOS 26 if available, then verify that sourceView/sourceRect are only configured for iPad and that existing iPad behavior remains intact.
Written by the indexing model from the issue text.
Description
Platform
share_plus: 13.2.0 (same code present in 12.x)- iOS 26.3 – 26.5.2, iPhone (reproduced on iPhone 16e / 17 Pro / 17 Pro Max, simulator and physical devices)
- Flutter 3.44.4
Description
In FPPSharePlusPlugin.m, popoverPresentationController.sourceView is assigned unconditionally, regardless of UIUserInterfaceIdiom:
activityViewController.popoverPresentationController.sourceView = topViewController.view;
if (!CGRectIsEmpty(origin)) {
activityViewController.popoverPresentationController.sourceRect = origin;
}
There is no way to opt out from Dart: even when the caller passes no sharePositionOrigin, sourceView is still set.
On iPhone this used to be harmless, but on iOS 26 a non-nil sourceView routes UIActivityViewController into the popover/anchored presentation path (compact sheet anchored to the Flutter view). When the user dismisses that sheet interactively (swipe down — most reliably after visiting a sub-screen such as AirDrop and coming back), the dismissal can end up in a broken state:
completionWithItemsHandleris never called → theFuturereturned bySharePlus.share()never completes, and anyawait/finallyafter it is dead.- The
UIActivityViewControllercan staypresentedwithisBeingDismissed == trueindefinitely (interrupted interactive dismissal never finishes), or stay presented with its view already detached from the window. - Touch delivery inside the app degrades: taps in part of the Flutter UI (in our case the bottom sheet under the share origin) stop being delivered until the presentation stack is rebuilt (e.g., by pushing/popping any route). Instrumentation shows events dying before reaching gesture handlers while the widget tree is healthy.
Steps to reproduce
- iPhone with iOS 26.x, any app calling
SharePlus.instance.share(ShareParams(uri: ...))(nosharePositionOrigin). - Open the share sheet, optionally enter the AirDrop sub-screen and come back.
- Dismiss the sheet with a swipe-down gesture.
- Observe: the
share()Future often never completes; in a fraction of runs taps around the share origin stop working.
The race is timing-sensitive (roughly 1 in 3 attempts in our testing), the AirDrop detour makes it much more reliable.
Expected
sourceView/popover configuration only applies on iPad (wheresharePositionOriginis genuinely required), or is at least skippable from Dart.completionWithItemsHandlerfires (withcompleted == false) for interrupted interactive dismissals so the returned Future always completes.
Workaround we ship (vendored fork)
Wrapping the popover configuration in an idiom check fixes the iPhone path while keeping iPad behavior intact:
BOOL isIpad = ([UIDevice currentDevice].userInterfaceIdiom == UIUserInterfaceIdiomPad);
if (isIpad) {
activityViewController.popoverPresentationController.sourceView =
topViewController.view;
if (!CGRectIsEmpty(origin)) {
activityViewController.popoverPresentationController.sourceRect = origin;
}
}
The hung-completion part still needs an app-level watchdog on iOS 26 even with this patch (the OS sometimes drops the completion for interrupted dismissals), but the touch-delivery breakage no longer reproduces with sourceView unset on iPhone.
Happy to send a PR with the idiom guard if that direction works for the maintainers.
- Dominant language
- Dart
- Stars
- 1.9k
- Forks
- 1.3k
- PR merge metrics
- No merged PRs in 30d
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from fluttercommunity/plus_plugins
-
bug triage
Difficulty 1/5 Under an hour Newbie friendliness 88/100
fluttercommunity/plus_plugins#3964 ·
-
Difficulty 4/5 3-5 days Newbie friendliness 35/100
fluttercommunity/plus_plugins#3974 ·
-
enhancement triage
Difficulty 5/5 Over a week Newbie friendliness 48/100
fluttercommunity/plus_plugins#3973 ·
-
bug triage
Difficulty 3/5 1-2 days Newbie friendliness 68/100
fluttercommunity/plus_plugins#3968 · 1 comment ·
-
[Bug]: [share_plus] Windows: hard crash on share() when the app has no implicit view (multi-window) Openbug triage
Difficulty 3/5 1-2 days Newbie friendliness 72/100
fluttercommunity/plus_plugins#3962 ·
All issues in fluttercommunity/plus_plugins
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
-
code quality good first issue
Difficulty 2/5 1-3 hours Newbie friendliness 90/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Suwayomi/Suwayomi-Tsumiru#479 ·
-
Build Failure: agora_rtc_engine compiled against android-31 while dependencies require android-34+ Open
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 92/100
conceptadev/noir#95 ·