Repository navigation
feat: add iOS UIScene life cycle support - #220
Merged
Merged
Conversation
Register the core plugin as a scene delegate so deep links are received via scene(_:openURLContexts:) in apps that adopt the UIScene life cycle. The UIApplicationDelegate path is kept for apps that have not migrated. - Require Flutter >=3.38.0 (first release with the scene plugin API) - Bump segment_analytics to 1.2.0 - Migrate the example app to UIScene Fixes #192 Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
- Resolve CHANGELOG/pubspec conflicts: keep 1.2.0 above main's 1.1.13 - Bump segmentVersion in lib/version.dart to 1.2.0 - Point older-Flutter users at 1.1.13 (latest release without the 3.38 floor) - Raise the pinned CI/publish Flutter SDK from 3.29.2 to 3.38.0 (new sha256) to satisfy the new minimum Flutter version - Regenerate test mocks (stale against Flutter 3.38 framework classes) and exclude the generated file from analysis Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
MichaelGHSeg
approved these changes
Oct 13, 2026
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.
Summary
Fixes #192. Flutter and Apple are moving iOS apps to the UIScene life cycle. In a UIScene app, UIKit no longer calls
application(_:open:options:), so the core plugin's deep link tracking (trackDeeplinks) would silently stop receiving URLs.AnalyticsPluginnow also conforms toFlutterSceneLifeCycleDelegate, registers withregistrar.addSceneDelegate, and handlesscene(_:openURLContexts:). Flutter forwards both warm URLs and the cold-start launch URL there.UIApplicationDelegatepath is kept for apps that have not migrated; both paths share onehandleDeeplinkhelper.AppDelegatewithFlutterImplicitEngineDelegate, newSceneDelegate, scene manifest inInfo.plist) and registers asegmentexample://URL scheme for testing deep links.segment_analyticsbumped to 1.2.0, minimum Flutter raised to 3.38.0.Breaking change / compatibility
addSceneDelegate:andFlutterSceneLifeCycleDelegateonly exist from Flutter 3.38.0. Apps on older Flutter should stay onsegment_analytics1.1.12. This is noted in the CHANGELOG and README.Testing
iOS 18.3 simulator (iPhone 16), using
xcrun simctl openurland a temporary log in the handler (not included). Each URL was delivered exactly once.Not tested: non-scene app on 3.44.9, physical devices, universal links, and the
Deep Link Openedevent payload on the Dart side.An early version also handled
willConnectTo, which delivered the cold-start URL twice; that handler was removed.Known unrelated issue
14 Dart test files in
packages/corefail to compile on Flutter 3.38.0 (67 pass). They fail identically on a clean checkout ofmain: the generatedtest/mocks/mocks.mocks.dartis out of date against newer Flutter framework classes. Not addressed here.🤖 Generated with Claude Code