Mobile-171: UISceneDelegate support#194
Merged
Merged
Conversation
`MindboxFlutterAppDelegate` is scene-safe (never touches `window` or `rootViewController`), but the inline comments did not reflect how its callbacks behave once the host app declares `UIApplicationSceneManifest`. Add markers at the two callbacks whose semantics change: `application(_:didFinishLaunchingWithOptions:)` — `launchOptions` is nil in scene mode; the cold-start payload arrives in the customer's `scene(_:willConnectTo:options:)` and must be forwarded via `Mindbox.shared.track(.launchScene(...))`. `application(_:continue:restorationHandler:)` — not invoked in scene mode; universal links arrive in the customer's `scene(_:continue:)` and must be forwarded via `Mindbox.shared.track(.universalLink(...))`. Translate the pre-existing inline comments in the file from Russian to English to align with the repository's language convention. No behavior change.
Add `SceneDelegate.swift` forwarding `.launchScene` and `.universalLink` to Mindbox, and declare `UIApplicationSceneManifest` in `Info.plist`. The two example `AppDelegate` variants now conform to `FlutterImplicitEngineDelegate`: under UISceneDelegate the engine is created by the scene, so `window`/`rootViewController` are not yet available in `didFinishLaunchingWithOptions`, and plugin / `FlutterEventChannel` setup has to move into `didInitializeImplicitFlutterEngine(_:)`. Each `AppDelegate` carries a header block labeling it as the migrated variant with links to Flutter's UISceneDelegate guide and the Mindbox `UISCENE_MIGRATION.md`, plus a commented-out pre-migration class at the bottom of the file as a reference for projects still on the legacy AppDelegate-only flow. `pubspec.yaml` now requires Flutter `>=3.41` (first version where UISceneDelegate is the recommended Flutter iOS lifecycle and `FlutterImplicitEngineDelegate` is available) so anyone trying to run the example on an older SDK gets a clear `pub get` error instead of a build-time surprise. The SDK packages themselves keep their existing Flutter `>=2.0.0` constraint — only the example is gated.
Apps that declare `UIApplicationSceneManifest` in `Info.plist` no longer receive `application(_:didFinishLaunchingWithOptions:)` with a populated `launchOptions`, and `application(_:continue:restorationHandler:)` is not invoked at all — universal-link arrivals land in `scene(_:continue:)` on the scene delegate. Without forwarding those events Mindbox loses launch and universal-link tracking. `UISCENE_MIGRATION.md` (at the repo root for discoverability) describes only the Mindbox-side glue: where to call `Mindbox.shared.track(.launchScene(_:))` and `Mindbox.shared.track(.universalLink(_:))` from the customer's `SceneDelegate`, and confirms that the rest (APNS token, push handlers, BG tasks, notification extensions, `MindboxFlutterAppDelegate`) needs no changes under scene mode. Anything that is not Mindbox-specific points at the official Flutter UISceneDelegate guide instead of duplicating it. The repo `README.md` is the single entry point linking to the guide — the per-package READMEs (`mindbox`, `mindbox_ios`) are not the right place for scene-mode integration guidance, since UISceneDelegate is an app-side migration with no implications for the SDK packages themselves.
There was a problem hiding this comment.
Pull request overview
Adds guidance and example updates to support Flutter iOS apps migrating to the UISceneDelegate lifecycle while keeping Mindbox launch/universal-link tracking working.
Changes:
- Added a dedicated UISceneDelegate migration guide and linked it from the main README.
- Updated the iOS example app to use
UIApplicationSceneManifest+SceneDelegate, and moved plugin/channel setup toFlutterImplicitEngineDelegate. - Clarified
MindboxFlutterAppDelegatebehavior under scene-based lifecycle (comments + formatting tweaks).
Reviewed changes
Copilot reviewed 13 out of 13 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
UISCENE_MIGRATION.md |
New migration guide describing where to forward Mindbox launch + universal link events in scene-based apps. |
README.md |
Adds a pointer to the UISceneDelegate migration guide. |
mindbox_ios/ios/Classes/MindboxFlutterAppDelegate.swift |
Updates comments to explain what becomes inert under UISceneDelegate and where to forward events. |
example/flutter_example/pubspec.yaml |
Pins the example to Flutter >=3.41.0 to support FlutterImplicitEngineDelegate. |
example/flutter_example/ios/Runner/SceneDelegate.swift |
Adds a scene delegate that forwards scene cold-start + universal links to Mindbox. |
example/flutter_example/ios/Runner/Info.plist |
Enables UIApplicationSceneManifest and wires SceneDelegate. |
example/flutter_example/ios/Runner/AppDelegateUsedMindboxDelegate.swift |
Migrates the “use MindboxFlutterAppDelegate base class” example to implicit engine initialization. |
example/flutter_example/ios/Runner/AppDelegate.swift |
Migrates the “plain FlutterAppDelegate” example to implicit engine initialization (keeps legacy variant commented). |
example/flutter_example/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme |
Updates scheme to run Flutter “prepare” pre-action and set Flutter LLDB init. |
example/flutter_example/ios/Runner.xcodeproj/project.pbxproj |
Adds SceneDelegate.swift to sources and adds the generated SwiftPM package reference. |
example/flutter_example/ios/Podfile |
Updates the commented platform hint to iOS 13.0. |
example/flutter_example/ios/Flutter/AppFrameworkInfo.plist |
Removes MinimumOSVersion entry. |
example/flutter_example/.gitignore |
Ignores SwiftPM/FVM related directories. |
Comments suppressed due to low confidence (1)
UISCENE_MIGRATION.md:107
- This relative link also uses
../example/...even though the file is at the repository root, which makes the reference implementation link broken. Use a correct relative path fromUISCENE_MIGRATION.md(e.g.,example/flutter_example/ios/Runner).
## Reference implementation
[`example/flutter_example/ios/Runner`](../example/flutter_example/ios/Runner)
is fully migrated and serves as a working reference for both the
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
…xample After UISCENE_MIGRATION.md moved to the repo root, the in-source link in SceneDelegate.swift and two relative paths inside the doc still pointed at the old `mindbox_ios/...` and `../example/...` locations. Switched them to absolute GitHub URLs on `develop`, matching the developers.mindbox.ru callout and the in-source comment. Also rewrote the SceneDelegate.swift header comment: `FlutterSceneDelegate` itself needs Flutter ≥ 3.35, but the example app pins to ≥ 3.41 because of `FlutterImplicitEngineDelegate` in AppDelegate.
sergeysozinov
approved these changes
May 20, 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.
Issue
Only Example changed