Skip to content

chore(ios): migrate example app to UIScene lifecycle - #214

Merged
ddfreiling merged 2 commits into
Notalib:mainfrom
ddfreiling:chore/ios-uiscene-lifecycle
Aug 27, 2026
Merged

chore(ios): migrate example app to UIScene lifecycle#214
ddfreiling merged 2 commits into
Notalib:mainfrom
ddfreiling:chore/ios-uiscene-lifecycle

Conversation

@ddfreiling

Copy link
Copy Markdown
Member

UIScene lifecycle is required on iOS 27+. flutter_tools hard-fails to launch an unmigrated app there (ios/devices.dart:878), so this is a launch blocker, not just the CLI warning.

Ran Flutter's own UIScene migrator rather than hand-editing: stripped AppDelegate.swift to the stock template, let the tool migrate, then re-added import flutter_readium and onCustomEditingAction(). The plist key is therefore written by Flutter's plutil-backed parser.

  • Info.plist — adds UIApplicationSceneManifest, pointing at FlutterSceneDelegate.
  • AppDelegate.swift — conforms to FlutterImplicitEngineDelegate; plugin registration moves to didInitializeImplicitFlutterEngine.

No SceneDelegate.swift: the migrator uses FlutterSceneDelegate directly, which avoids a project.pbxproj edit for no behaviour difference.

Plugin sources needed no change — no UIApplication.shared, keyWindow, .windows, or app-lifecycle delegate hooks anywhere in flutter_readium/ios/.

Second commit is unrelated but small: the example bookshelf now explains that an empty shelf means bin/fetch_test_resources hasn't been run, instead of rendering blank.

Verification

On an iPhone 17 Pro simulator:

  • Migrator printed Finished migration to UIScene lifecycle.
  • Clean re-run of flutter build ios --config-only — no UIScene warnings.
  • App launches; bookshelf loads; opening Moby Dick renders the EPUB in the native webview (checked via simctl io screenshot, since webviews don't appear in marionette captures).
  • Empty state confirmed by moving fixtures aside and wiping app storage, then restored.
  • bin/format and bin/analyze clean.

No CHANGELOG entry — both changes are example-app only.

🤖 Generated with Claude Code

ddfreiling and others added 2 commits August 27, 2026 23:39
UIScene lifecycle is required on iOS 27 and later; flutter_tools hard-fails
to launch an unmigrated app there. Ran Flutter's own UIScene migrator, which
adds UIApplicationSceneManifest to Info.plist and moves plugin registration
from didFinishLaunchingWithOptions to didInitializeImplicitFlutterEngine.

Uses FlutterSceneDelegate directly rather than adding an empty SceneDelegate
subclass, matching the migrator's output.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Test fixtures are generated and gitignored, so a fresh checkout shows a
blank shelf with no explanation. Point at bin/fetch_test_resources instead.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@ddfreiling

Copy link
Copy Markdown
Member Author

Just example app maintenance, merging

@ddfreiling
ddfreiling merged commit 1ce645d into Notalib:main Aug 27, 2026
13 of 14 checks passed
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