Skip to content

Fix crash on iOS when UISceneDelegate lifecycle is adopted#146

Open
m-sugawara wants to merge 1 commit into
0maru:mainfrom
m-sugawara:fix/ios-crash
Open

Fix crash on iOS when UISceneDelegate lifecycle is adopted#146
m-sugawara wants to merge 1 commit into
0maru:mainfrom
m-sugawara:fix/ios-crash

Conversation

@m-sugawara

Copy link
Copy Markdown

Fix #145

Updated presentationAnchor(for:) to retrieve the window in the following priority order:

  1. FlutterPluginRegistrar.viewController - Use the view controller's window provided by Flutter (most reliable)
  2. UIScene-based retrieval (iOS 13+) - Iterate through connected scenes to find the active foreground scene's key window
  3. Legacy fallback - Fall back to AppDelegate.window for apps not using UIScene lifecycle

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Crash on iOS when UISceneDelegate lifecycle is adopted

1 participant