Skip to content

Add UIScene lifecycle support for iOS#137

Merged
onevcat merged 8 commits intomasterfrom
feature/uiscene-lifecycle-support
Mar 10, 2026
Merged

Add UIScene lifecycle support for iOS#137
onevcat merged 8 commits intomasterfrom
feature/uiscene-lifecycle-support

Conversation

@onevcat
Copy link
Member

@onevcat onevcat commented Mar 9, 2026

Summary

  • Add FlutterSceneLifeCycleDelegate support to the iOS plugin, ensuring LINE login callbacks work correctly when the host app adopts UIScene-based lifecycle (required by Apple post-iOS 26)
  • The plugin now registers both UIApplicationDelegate and FlutterSceneLifeCycleDelegate callbacks, so it works with both migrated and non-migrated host apps
  • Migrate the example app to UIScene lifecycle (auto-migrated by Flutter 3.41 tooling)
  • Bump minimum Flutter SDK to 3.38.0 and Dart SDK to 3.8.0 for FlutterSceneLifeCycleDelegate API availability

Details

Apple announced that apps built with the latest SDK will be required to use the UIScene lifecycle in the release following iOS 26. Flutter introduced FlutterSceneLifeCycleDelegate in 3.38.0 to support this migration for plugins.

The plugin's two URL handling methods (application(_:open:options:) for URL schemes and application(_:continue:restorationHandler:) for universal links) will not be called once a host app migrates to UIScene. This PR adds the scene-based equivalents (scene(_:openURLContexts:) and scene(_:continue:)) that bridge URLs to LINE SDK's LoginManager using the same caller-side bridging pattern recommended by LINE SDK Swift.

No changes to LINE SDK Swift dependency are needed — LoginManager.shared.application(.shared, open: url) accepts URLs regardless of how they were received.

Closes #136

Test plan

  • flutter analyze — no new issues
  • flutter test — 7/7 passed
  • iOS build (flutter build ios) — success
  • Manual test: login flow with UIScene lifecycle (new path via scene(_:openURLContexts:))
  • Manual test: login flow with legacy AppDelegate lifecycle (old path via application(_:open:options:), verified by disabling UIScene migration)

🤖 Generated with Claude Code

onevcat and others added 6 commits March 9, 2026 11:56
Register FlutterSceneLifeCycleDelegate alongside the existing
UIApplicationDelegate to handle LINE login callbacks when the
host app adopts the UIScene-based lifecycle.

Implements scene(_:openURLContexts:) and scene(_:continue:)
which bridge URL handling to LoginManager, matching the existing
application delegate pattern.

Ref: #136

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Required for FlutterSceneLifeCycleDelegate and
registrar.addSceneDelegate() API availability.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
The protocol conformance must be explicitly declared for the
compiler to accept the type passed to addSceneDelegate().

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Auto-migrated by Flutter 3.41 tooling:
- Add UIApplicationSceneManifest to Info.plist
- Update AppDelegate to use FlutterImplicitEngineDelegate
- Bump iOS deployment target from 12.0 to 13.0
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@onevcat onevcat force-pushed the feature/uiscene-lifecycle-support branch 2 times, most recently from 8f48813 to be28033 Compare March 9, 2026 03:05
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@onevcat onevcat requested a review from daviscdev March 9, 2026 03:12
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Copy link

@daviscdev daviscdev left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM Thank you!

@onevcat onevcat merged commit dc22286 into master Mar 10, 2026
2 checks passed
@onevcat onevcat deleted the feature/uiscene-lifecycle-support branch March 10, 2026 05:07
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.

Add UIScene life cycle support

2 participants