Skip to content

Mobile-171: UISceneDelegate support#194

Merged
justSmK merged 4 commits into
developfrom
feature/MOBILE-171-SceneDelegate-support
May 20, 2026
Merged

Mobile-171: UISceneDelegate support#194
justSmK merged 4 commits into
developfrom
feature/MOBILE-171-SceneDelegate-support

Conversation

@justSmK
Copy link
Copy Markdown
Collaborator

@justSmK justSmK commented May 19, 2026

Issue
Only Example changed

justSmK added 3 commits May 18, 2026 15:51
`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.
Copilot AI review requested due to automatic review settings May 19, 2026 15:47
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

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 to FlutterImplicitEngineDelegate.
  • Clarified MindboxFlutterAppDelegate behavior 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 from UISCENE_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.

Comment thread UISCENE_MIGRATION.md Outdated
Comment thread example/flutter_example/ios/Runner/SceneDelegate.swift Outdated
Comment thread example/flutter_example/ios/Runner/SceneDelegate.swift Outdated
…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.
@justSmK justSmK requested review from Vailence and sergeysozinov May 19, 2026 16:05
@justSmK justSmK merged commit c579af0 into develop May 20, 2026
9 checks passed
@justSmK justSmK deleted the feature/MOBILE-171-SceneDelegate-support branch May 20, 2026 10:27
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.

3 participants