Skip to content

fix(ios): UIScene-safe viewController; bump deployment target to 13.0#4

Open
wonderu wants to merge 1 commit into
decodevM:flutter-3.29from
wonderu:flutter-3.29
Open

fix(ios): UIScene-safe viewController; bump deployment target to 13.0#4
wonderu wants to merge 1 commit into
decodevM:flutter-3.29from
wonderu:flutter-3.29

Conversation

@wonderu

@wonderu wonderu commented May 6, 2026

Copy link
Copy Markdown

The pre-existing register(with:) force-unwrapped
UIApplication.shared.delegate.window, which is nil under Flutter's UIScene lifecycle (Flutter 3.32+). The plugin crashed with EXC_BAD_INSTRUCTION at app launch on Flutter 3.41.

  • Replace stored static viewController with a computed property that resolves the active UIWindowScene's root view controller at access time, with a fallback to the legacy AppDelegate.window path.
  • Drop the broken assignment from register(with:); registration is now side-effect-free.
  • Replace deprecated UIApplication.shared.statusBarOrientation with the windowScene.interfaceOrientation equivalent.
  • Bump podspec ios.deployment_target from 12.0 to 13.0 (UIScene min).
  • Widen pubspec SDK constraint to allow Dart 3.x callers.

The pre-existing register(with:) force-unwrapped
UIApplication.shared.delegate.window, which is nil under Flutter's
UIScene lifecycle (Flutter 3.32+). The plugin crashed with
EXC_BAD_INSTRUCTION at app launch on Flutter 3.41.

- Replace stored static viewController with a computed property that
  resolves the active UIWindowScene's root view controller at access
  time, with a fallback to the legacy AppDelegate.window path.
- Drop the broken assignment from register(with:); registration is now
  side-effect-free.
- Replace deprecated UIApplication.shared.statusBarOrientation with
  the windowScene.interfaceOrientation equivalent.
- Bump podspec ios.deployment_target from 12.0 to 13.0 (UIScene min).
- Widen pubspec SDK constraint to allow Dart 3.x callers.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
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.

1 participant