Repository navigation
fix(ios): presenting view controller crashes with the UIScene life cycle (React Native 0.88 template) - #498
Merged
RonRadtke merged 1 commit intoNov 9, 2026
Conversation
The presenting-view-controller provider sent `window` to the app delegate. React Native 0.88's template moves the window to SceneDelegate (the UIScene life cycle is required to launch once an app is built with the iOS 27 SDK), and its AppDelegate has no `window`, so presenting the options or open-in menu threw: -[AppDelegate window]: unrecognized selector sent to instance RCTPresentedViewController() resolves the key window through the connected scenes and returns the top-most presented controller. It has been in React/RCTUtils.h since well before 0.68, so older apps keep working.
RonRadtke
added a commit
that referenced
this pull request
Nov 9, 2026
RonRadtke
added a commit
that referenced
this pull request
Nov 9, 2026
…port of #498) presentOptionsMenu and presentOpenInMenu took the view to present from as [[[[UIApplication sharedApplication] delegate] window] rootViewController]. React Native 0.88's template moves the window to a scene delegate, and apps need the UIScene life cycle to launch once they build with the iOS 27 SDK, so the template's AppDelegate has no `window` and the first menu ended the app: "-[AppDelegate window]: unrecognized selector sent to instance". The preview delegate method used the deprecated keyWindow's root controller. All three now use RCTPresentedViewController(), which finds the key window through the connected scenes and walks up to the controller on top, as #498 does on master. That also makes a menu opened over a modal screen appear: UIKit does not present from a controller that is already presenting one, so it did nothing (#311). The two menu lookups moved inside the main-queue blocks that already present them, because the helper reads UIKit state; the old lookup ran on the module's queue. 0.25 has no iOS unit test target. The same provider is covered by XCTests on master; #498's author verified this change on 0.25.1 in a React Native 0.88 app (the options menu shows, the app keeps running). Not compiled on this machine.
RonRadtke
added a commit
that referenced
this pull request
Nov 9, 2026
Migration.md is the guide from 0.25 to 1.x. A crash or a call that did nothing, fixed in 1.1.1, is nothing to migrate around, so its row only repeated the release notes: the iOS document menus (#498), an empty multipart form on iOS (#197), the Downloads-app entry on Android (#390), open.chooser on Android (#486) and lstat on an unreadable folder (#425). They are gone; the row for that folder keeps the one visible change, ls rejecting EACCES instead of EUNSPECIFIED. The release notes list every fix.
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.
What breaks
React Native 0.88's app template moves the window to a
SceneDelegate. Apps need the UIScene life cycle to launch once they are built with the iOS 27 SDK, which App Store Connect requires from April 2027. The template'sAppDelegateno longer has awindowproperty:The module's presenting-view-controller provider sends
windowto the app delegate, so the first call that presents UI ends the app:The fix
RCTPresentedViewController()fromReact/RCTUtils.hresolves the key window throughconnectedScenesand walks up to the top-most presented controller. It works with or without scenes, and it has been in React Native since long before 0.68, so nothing changes for older apps.How I tested it
I used a fresh
@react-native-community/cli initapp on React Native 0.88.0-rc.4, with its template unchanged (SceneDelegate, no window on AppDelegate). The app writes a file and callsReactNativeBlobUtil.ios.presentOptionsMenu(path)3 s after launch. Each run was a release build on an iOS 26.2 simulator (iPhone Air):RCTPresentedViewController()npm packThe
android/gradlew.batline-ending change that a fresh checkout shows is not part of this PR.(Found while scanning the iOS sources of popular React Native libraries for the UIScene move with NativeKeel. This pattern shows up in about a dozen packages.)