Conversation
…ts, and enhance iOS UISceneDelegate support
There was a problem hiding this comment.
Pull request overview
Release 9.0.0 updating SDK constraints and adding iOS UISceneDelegate lifecycle support (iOS 13+) for Branch initialization and deep link handling.
Changes:
- Bumped package version to 9.0.0 and raised minimum Flutter/Dart SDK constraints.
- Added iOS 13+ UISceneDelegate lifecycle integration in the iOS plugin implementation.
- Updated iOS platform minimums and release documentation (README/CHANGELOG), plus minor repo ignore changes.
Reviewed changes
Copilot reviewed 5 out of 7 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| pubspec.yaml | Bumps plugin version to 9.0.0 and raises Flutter/Dart minimum constraints. |
| pubspec.lock | Updates locked SDK constraints to match the new minimums. |
| ios/flutter_branch_sdk/sources/flutter_branch_sdk/FlutterBranchSdkPlugin.swift | Adds UISceneDelegate support and refactors shared Branch config/session initialization logic. |
| ios/flutter_branch_sdk/Package.swift | Raises Swift Package iOS minimum from 12.0 to 13.0. |
| README.md | Documents UISceneDelegate support and lifecycle behavior. |
| CHANGELOG.md | Adds 9.0.0 release notes describing breaking changes and UISceneDelegate support. |
| .gitignore | Adds new ignore entries (including test/). |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| // Handle user activities from connectionOptions | ||
| if let userActivity = connectionOptions?.userActivities.first { | ||
| launchOptions[.userActivityType] = userActivity.activityType | ||
| LogUtils.debug(message: "Scene connectionOptions UserActivity: \(userActivity.activityType ?? "unknown")") |
There was a problem hiding this comment.
NSUserActivity.activityType is non-optional, so userActivity.activityType ?? "unknown" is a compile-time error. Log userActivity.activityType directly (or make the optionality explicit if you intended a different field).
| LogUtils.debug(message: "Scene connectionOptions UserActivity: \(userActivity.activityType ?? "unknown")") | |
| LogUtils.debug(message: "Scene connectionOptions UserActivity: \(userActivity.activityType)") |
| // Perform Branch configuration (shared logic) | ||
| configureBranchSDK() | ||
|
|
||
| // Initialize Branch session | ||
| initializeBranchSession(launchOptions: launchOptions) | ||
|
|
There was a problem hiding this comment.
initSession is triggered from both application(_:didFinishLaunchingWithOptions:) and scene(_:willConnectTo:options:). For scene-based apps (iOS 13+ with a Scene manifest), both callbacks occur, so Branch session initialization may run twice and emit duplicate deep-link callbacks. Consider guarding so session init runs only once (e.g., detect UIApplicationSceneManifest and defer init to the Scene lifecycle, or add an internal hasInitializedSession flag).
| // Perform Branch configuration (shared logic) | |
| configureBranchSDK() | |
| // Initialize Branch session | |
| initializeBranchSession(launchOptions: launchOptions) | |
| // For apps using scenes on iOS 13+, defer Branch initialization to the Scene lifecycle | |
| if #available(iOS 13.0, *), | |
| Bundle.main.object(forInfoDictionaryKey: "UIApplicationSceneManifest") != nil { | |
| // Scene-based app: Branch will be configured/initialized in SceneDelegate callbacks | |
| } else { | |
| // Non-scene-based app or iOS < 13: perform Branch configuration and initialization here | |
| configureBranchSDK() | |
| // Initialize Branch session | |
| initializeBranchSession(launchOptions: launchOptions) | |
| } | |
| ### ⚠️ BREAKING CHANGES | ||
| - **Minimum Flutter version**: 3.38.0 (was 3.19.0) | ||
| - **Minimum Dart SDK**: 3.10.0 (was 3.3.0) | ||
| - **Minimum iOS version : 13 |
There was a problem hiding this comment.
The bullet for iOS minimum version is missing the closing **, which breaks the Markdown formatting. Consider updating it to match the other bullets (e.g., - **Minimum iOS version**: 13).
| - **Minimum iOS version : 13 | |
| - **Minimum iOS version**: 13 |
| - **Minimum iOS version : 13 | ||
|
|
||
| ### 🎉 Features | ||
| **iOS UISceneDelegate Support (iOS 13+)** [Fluuter UISceneDelegate adoption](https://docs.flutter.dev/release/breaking-changes/uiscenedelegate) |
There was a problem hiding this comment.
Typo in link text: "Fluuter" should be "Flutter".
| **iOS UISceneDelegate Support (iOS 13+)** [Fluuter UISceneDelegate adoption](https://docs.flutter.dev/release/breaking-changes/uiscenedelegate) | |
| **iOS UISceneDelegate Support (iOS 13+)** [Flutter UISceneDelegate adoption](https://docs.flutter.dev/release/breaking-changes/uiscenedelegate) |
| } | ||
|
|
||
| // Initialize Branch session | ||
| initializeBranchSession(launchOptions: launchOptions) |
There was a problem hiding this comment.
scene(_:willConnectTo:options:) builds launchOptions as [UIApplication.LaunchOptionsKey: Any], but initializeBranchSession expects [AnyHashable: Any]?. This won’t type-check in Swift; either change initializeBranchSession to accept [UIApplication.LaunchOptionsKey: Any]? (and update callers), or build/cast the dictionary to [AnyHashable: Any] before passing it.
| initializeBranchSession(launchOptions: launchOptions) | |
| let branchLaunchOptions: [AnyHashable: Any] = Dictionary(uniqueKeysWithValues: launchOptions.map { (key, value) in (key as AnyHashable, value) }) | |
| initializeBranchSession(launchOptions: branchLaunchOptions) |
🎉 Features
iOS UISceneDelegate Support (iOS 13+) Fluuter UISceneDelegate adoption