Skip to content

[iOS] Add native deep link lifecycle integration tests for UIScene plugins - #192173

Merged
auto-submit[bot] merged 7 commits into
flutter:masterfrom
okorohelijah:module-uiscene-plugin-test
Sep 4, 2026
Merged

auto-submit[bot] merged 7 commits into
flutter:masterfrom
okorohelijah:module-uiscene-plugin-test

Conversation

@okorohelijah

@okorohelijah okorohelijah commented Sep 2, 2026 •

Copy link
Copy Markdown
Contributor

Description

Extends native iOS Add-to-App UIScene lifecycle testing by validating deep link (Universal Links and custom URL schemes) delivery to plugins across both cold and warm starts.

As discussed on #191443, this PR decouples native plugin lifecycle verification from the standalone app route delivery test:

  • Renames module_uiscene_test_ios to uiscene_plugin_lifecycle_test_ios across CI (.ci.yaml), TESTOWNERS, and task runners to accurately reflect its role in verifying plugin lifecycle events.
  • Adds two new test scenarios to uiscene_plugin_lifecycle_test_ios.dart:
    • AppMigrated-FlutterSceneDelegate-PluginMigrated-DeepLink: Verifies plugins adopting FlutterSceneLifeCycleDelegate receive connection options, openURLContexts, and continueUserActivity.
    • AppMigrated-FlutterSceneDelegate-PluginNotMigrated-DeepLink: Verifies legacy plugins implementing FlutterApplicationLifeCycleDelegate receive fallback callbacks via FlutterPluginAppLifeCycleDelegate.
  • . Adds UITests-DeepLinks.swift verifying warm/cold × universal link/custom scheme

Part of #191443

Pre-launch Checklist

…ugins

Extends native iOS Add-to-App UIScene lifecycle testing by validating deep link (Universal Links and custom URL schemes) delivery to plugins across both cold and warm starts.

As discussed with reviewers on flutter#191443, this decouples native plugin lifecycle verification from the standalone app route delivery test:
1. Renames module_uiscene_test_ios to uiscene_plugin_lifecycle_test_ios across CI, testowners, and task runners to accurately reflect its role in verifying plugin lifecycle events.
2. Adds two new test scenarios to uiscene_plugin_lifecycle_test_ios.dart:
   - AppMigrated-FlutterSceneDelegate-PluginMigrated-DeepLink: Verifies plugins adopting FlutterSceneLifeCycleDelegate receive connection options, openURLContexts, and continueUserActivity.
   - AppMigrated-FlutterSceneDelegate-PluginNotMigrated-DeepLink: Verifies legacy plugins implementing FlutterApplicationLifeCycleDelegate receive fallback callbacks via FlutterPluginAppLifeCycleDelegate.
3. Adds UITests-DeepLinks.swift verifying all 4 permutations (warm/cold x universal link/custom scheme) using native app.open(url) with exact occurrence validation.
4. Configures associated domains entitlements (applinks:flutter-dashboard.appspot.com) and bundle identifier (com.google.experimental0.dev) for the test projects.
@github-actions github-actions Bot added the team-ios Owned by iOS platform team label Sep 2, 2026
@okorohelijah
okorohelijah marked this pull request as ready for review September 2, 2026 10:45
@okorohelijah
okorohelijah requested a review from a team as a code owner September 2, 2026 10:45
@okorohelijah okorohelijah added the CICD Run CI/CD label Sep 2, 2026

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Code Review

This pull request renames the iOS UI scene test task to uiscene_plugin_lifecycle_test_ios and introduces deep link testing scenarios. It configures custom URL schemes and associated domains (entitlements) for the integration test apps, updates the migrated and unmigrated lifecycle plugins to log incoming URLs, and adds a new UI test suite (UITests-DeepLinks.swift) to verify warm and cold starts via universal links and custom schemes. I have no feedback to provide.

Comment thread dev/integration_tests/ios_add2app_uiscene/native/UITests-DeepLinks.swift Outdated
Comment thread dev/integration_tests/ios_add2app_uiscene/native/UITests-DeepLinks.swift Outdated
Comment thread dev/integration_tests/ios_add2app_uiscene/native/UITests-DeepLinks.swift Outdated
@flutter-dashboard

Copy link
Copy Markdown

This pull request has been changed to a draft. The currently pending flutter-gold status will not be able to resolve until a new commit is pushed or the change is marked ready for review again.

For more guidance, visit Writing a golden file test for package:flutter.

Reviewers: Read the Tree Hygiene page and make sure this patch meets those guidelines before LGTMing.

@okorohelijah
okorohelijah marked this pull request as ready for review September 4, 2026 03:34

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Code Review

This pull request renames the iOS UI scene test to uiscene_plugin_lifecycle_test_ios and introduces comprehensive deep link and universal link testing scenarios. It configures associated domain entitlements, URL schemes, and deep link event logging in both migrated and unmigrated lifecycle plugins, supported by new UI tests for cold and warm starts. Feedback on the changes identifies several indentation and spacing violations in LifecyclePlugin-migrated.swift that should be corrected to adhere to the Google Swift Style Guide.

@hellohuanlin hellohuanlin left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

overall looks great!

return true
}

@objc(application:continueUserActivity:restorationHandler:)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

same here

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I initially added it in @objc(application:continueUserActivity:restorationHandler:) because the selector wasn't mapping properly when restorationHandler was an optional closure. After updating the signature to @escaping ([Any]) -> Void, the protocol handles the Objective-C selector mapping naturally, so I've removed the @objc tags.

button.tap()

let expectedEvents = [
"applicationDidFinishLaunchingWithOptions",

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

why duplicate calls above, but no duplicate here

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

On cold start, unmigrated plugins receive applicationDidFinishLaunchingWithOptions twice: once during initial plugin registration with FlutterEngine, and once when FlutterAppDelegate forwards it.

On warm start, the app has already completed its initial launch. When the deep link is opened while the app is backgrounded, iOS resumes the existing process via scene continuation / openURL without re-running the app launch lifecycle. Therefore, applicationDidFinishLaunchingWithOptions only appears from the initial launch and is not duplicated.

@okorohelijah

Copy link
Copy Markdown
Contributor Author

As a note for future reference: didFinishLaunchingWithOptions called twice is expected behavior for unmigrated plugins on deep link launches under UIScene. In iOS 13+, UIKit delivers empty launch options to didFinishLaunchingWithOptions and sends the actual URL via scene:willConnectToSession:options:. To maintain backward compatibility for plugins that haven't adopted FlutterSceneLifeCycleDelegate, the Flutter engine triggers sceneWillConnectFallback:, which converts the scene's connection options into UIApplicationLaunchOptionsURLKey and calls didFinishLaunchingWithOptions a second time (with isFallbackForScene: YES) specifically so legacy plugins can still receive the launch URL. Migrated plugins skip this fallback pass, which is why unmigrated plugins receive it twice.

pull Bot pushed a commit to Budda0ne/flutter that referenced this pull request Sep 4, 2026
This is a pivot of flutter#191201 to run on the iOS Simulator instead of
physical devicelab hardware to conserve capacity.

This PR introduces automated integration tests for iOS deep linking and
Universal Links for standard standalone Flutter apps on the iOS
Simulator.

1. **UIScene Lifecycle (`ios_universal_link`):**
- Tests the standard `UISceneDelegate` lifecycle
(`UIApplicationSceneManifest`) used by default Flutter apps.
2. **Complete Cold and Warm Start Coverage:**
- **HTTPS Universal Links:** Verified on both cold launch and warm
background resume.
- **Custom Schemes (`testscheme://`):** Verified on both cold launch and
warm background resume.
3. **End-to-End Route Delivery:**
- Verifies that the iOS deep link correctly traverses the Flutter Engine
and is delivered to the Dart framework (`pushRouteInformation`),
rendering the destination route on the UI for XCUITest assertion.
4. **Devicelab Automation:**
- Implemented `dev/devicelab/bin/tasks/ios_universal_link_test.dart` to
provision a clean simulator runtime, build the test app, run XCUITests
via `xcodebuild test`, and guarantee simulator teardown.
- Pre-warms simulator caches before assertion loops to prevent
first-frame deadline timeouts.

*(Note: Plugin lifecycle and Add-to-App deep link testing is decoupled
into flutter#192173).*

@hellohuanlin hellohuanlin left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM!

@okorohelijah okorohelijah added the autosubmit Merge PR when tree becomes green via auto submit App label Sep 4, 2026
@auto-submit auto-submit Bot removed the autosubmit Merge PR when tree becomes green via auto submit App label Sep 4, 2026
@auto-submit

auto-submit Bot commented Sep 4, 2026

Copy link
Copy Markdown
Contributor

autosubmit label was removed for flutter/flutter/192173, because - The status or check suite Dashboard Checks has failed. Please fix the issues identified (or deflake) before re-applying this label.

@okorohelijah okorohelijah added the autosubmit Merge PR when tree becomes green via auto submit App label Sep 4, 2026
@auto-submit
auto-submit Bot added this pull request to the merge queue Sep 4, 2026
Merged via the queue into flutter:master with commit 2d39b7d Sep 4, 2026
23 checks passed
@flutter-dashboard flutter-dashboard Bot removed the autosubmit Merge PR when tree becomes green via auto submit App label Sep 4, 2026
auto-submit Bot pushed a commit to flutter/packages that referenced this pull request Sep 5, 2026
flutter/flutter@5a6cfa7...63170e9

2026-09-05 [email protected] Roll Dart SDK from 6882c3b4b542 to 77094991d1c1 (1 revision) (flutter/flutter#192339)
2026-09-05 [email protected] Roll Skia from 10652f9d64d6 to db200e27a634 (1 revision) (flutter/flutter#192338)
2026-09-05 [email protected] Roll Fuchsia Linux SDK from FgDQeF6jb1dVRVh3K... to _IgixhH4vEgdz9Oqn... (flutter/flutter#192333)
2026-09-05 [email protected] Roll Dart SDK from 5744c2480a12 to 6882c3b4b542 (1 revision) (flutter/flutter#192331)
2026-09-05 [email protected] Roll Skia from 9b1e5fd08d2c to 10652f9d64d6 (4 revisions) (flutter/flutter#192329)
2026-09-05 [email protected] ci(engine): target ignore_phone|none for new macs (flutter/flutter#192317)
2026-09-04 [email protected] [devicelab] Fix Mac ios_universal_link_test CI build and scheme configuration (flutter/flutter#192321)
2026-09-04 [email protected] Roll Dart SDK from 5501d02b583d to 5744c2480a12 (5 revisions) (flutter/flutter#192316)
2026-09-04 [email protected] [iOS] Add native deep link lifecycle integration tests for UIScene plugins (flutter/flutter#192173)
2026-09-04 [email protected] Roll Skia from 93ac1e630d1d to 9b1e5fd08d2c (3 revisions) (flutter/flutter#192314)
2026-09-04 [email protected] [tool] Migrate AssembleCommand and GenerateCommand to modular dependency injection (flutter/flutter#190773)
2026-09-04 [email protected] [tool] Migrate Apple build subcommands and toolchain to modular dependency injection (flutter/flutter#190780)
2026-09-04 [email protected] [flutter_tools] Safely handle non-JSON messages in test stream parsers (flutter/flutter#192089)
2026-09-04 [email protected] [tool] Migrate LogsCommand to modular dependency injection (flutter/flutter#190765)
2026-09-04 [email protected] [tool] Migrate DevicesCommand to modular dependency injection (flutter/flutter#190768)

If this roll has caused a breakage, revert this CL and stop the roller
using the controls here:
https://autoroll.skia.org/r/flutter-packages
Please CC [email protected] on the revert to ensure that a human
is aware of the problem.

To file a bug in Packages: https://github.com/flutter/flutter/issues/new/choose

To report a problem with the AutoRoller itself, please file a bug:
https://issues.skia.org/issues/new?component=1389291&template=1850622

Documentation for the AutoRoller is here:
https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md
victorsanni pushed a commit to victorsanni/packages that referenced this pull request Sep 9, 2026
…r#12767)

flutter/flutter@5a6cfa7...63170e9

2026-09-05 [email protected] Roll Dart SDK from 6882c3b4b542 to 77094991d1c1 (1 revision) (flutter/flutter#192339)
2026-09-05 [email protected] Roll Skia from 10652f9d64d6 to db200e27a634 (1 revision) (flutter/flutter#192338)
2026-09-05 [email protected] Roll Fuchsia Linux SDK from FgDQeF6jb1dVRVh3K... to _IgixhH4vEgdz9Oqn... (flutter/flutter#192333)
2026-09-05 [email protected] Roll Dart SDK from 5744c2480a12 to 6882c3b4b542 (1 revision) (flutter/flutter#192331)
2026-09-05 [email protected] Roll Skia from 9b1e5fd08d2c to 10652f9d64d6 (4 revisions) (flutter/flutter#192329)
2026-09-05 [email protected] ci(engine): target ignore_phone|none for new macs (flutter/flutter#192317)
2026-09-04 [email protected] [devicelab] Fix Mac ios_universal_link_test CI build and scheme configuration (flutter/flutter#192321)
2026-09-04 [email protected] Roll Dart SDK from 5501d02b583d to 5744c2480a12 (5 revisions) (flutter/flutter#192316)
2026-09-04 [email protected] [iOS] Add native deep link lifecycle integration tests for UIScene plugins (flutter/flutter#192173)
2026-09-04 [email protected] Roll Skia from 93ac1e630d1d to 9b1e5fd08d2c (3 revisions) (flutter/flutter#192314)
2026-09-04 [email protected] [tool] Migrate AssembleCommand and GenerateCommand to modular dependency injection (flutter/flutter#190773)
2026-09-04 [email protected] [tool] Migrate Apple build subcommands and toolchain to modular dependency injection (flutter/flutter#190780)
2026-09-04 [email protected] [flutter_tools] Safely handle non-JSON messages in test stream parsers (flutter/flutter#192089)
2026-09-04 [email protected] [tool] Migrate LogsCommand to modular dependency injection (flutter/flutter#190765)
2026-09-04 [email protected] [tool] Migrate DevicesCommand to modular dependency injection (flutter/flutter#190768)

If this roll has caused a breakage, revert this CL and stop the roller
using the controls here:
https://autoroll.skia.org/r/flutter-packages
Please CC [email protected] on the revert to ensure that a human
is aware of the problem.

To file a bug in Packages: https://github.com/flutter/flutter/issues/new/choose

To report a problem with the AutoRoller itself, please file a bug:
https://issues.skia.org/issues/new?component=1389291&template=1850622

Documentation for the AutoRoller is here:
https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md
victorsanni pushed a commit to victorsanni/packages that referenced this pull request Sep 9, 2026
…r#12767)

flutter/flutter@5a6cfa7...63170e9

2026-09-05 [email protected] Roll Dart SDK from 6882c3b4b542 to 77094991d1c1 (1 revision) (flutter/flutter#192339)
2026-09-05 [email protected] Roll Skia from 10652f9d64d6 to db200e27a634 (1 revision) (flutter/flutter#192338)
2026-09-05 [email protected] Roll Fuchsia Linux SDK from FgDQeF6jb1dVRVh3K... to _IgixhH4vEgdz9Oqn... (flutter/flutter#192333)
2026-09-05 [email protected] Roll Dart SDK from 5744c2480a12 to 6882c3b4b542 (1 revision) (flutter/flutter#192331)
2026-09-05 [email protected] Roll Skia from 9b1e5fd08d2c to 10652f9d64d6 (4 revisions) (flutter/flutter#192329)
2026-09-05 [email protected] ci(engine): target ignore_phone|none for new macs (flutter/flutter#192317)
2026-09-04 [email protected] [devicelab] Fix Mac ios_universal_link_test CI build and scheme configuration (flutter/flutter#192321)
2026-09-04 [email protected] Roll Dart SDK from 5501d02b583d to 5744c2480a12 (5 revisions) (flutter/flutter#192316)
2026-09-04 [email protected] [iOS] Add native deep link lifecycle integration tests for UIScene plugins (flutter/flutter#192173)
2026-09-04 [email protected] Roll Skia from 93ac1e630d1d to 9b1e5fd08d2c (3 revisions) (flutter/flutter#192314)
2026-09-04 [email protected] [tool] Migrate AssembleCommand and GenerateCommand to modular dependency injection (flutter/flutter#190773)
2026-09-04 [email protected] [tool] Migrate Apple build subcommands and toolchain to modular dependency injection (flutter/flutter#190780)
2026-09-04 [email protected] [flutter_tools] Safely handle non-JSON messages in test stream parsers (flutter/flutter#192089)
2026-09-04 [email protected] [tool] Migrate LogsCommand to modular dependency injection (flutter/flutter#190765)
2026-09-04 [email protected] [tool] Migrate DevicesCommand to modular dependency injection (flutter/flutter#190768)

If this roll has caused a breakage, revert this CL and stop the roller
using the controls here:
https://autoroll.skia.org/r/flutter-packages
Please CC [email protected] on the revert to ensure that a human
is aware of the problem.

To file a bug in Packages: https://github.com/flutter/flutter/issues/new/choose

To report a problem with the AutoRoller itself, please file a bug:
https://issues.skia.org/issues/new?component=1389291&template=1850622

Documentation for the AutoRoller is here:
https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md
pull Bot pushed a commit to Mattlk13/flutter that referenced this pull request Sep 11, 2026
<!--
Thanks for filing a pull request!
Reviewers are typically assigned within a week of filing a request.
To learn more about code review, see our documentation on Tree Hygiene:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md
-->

remove ios_universal_link_test and uiscene_plugin_lifecycle_test_ios
deeplink integration tests from bringup

Part of flutter#191443,
flutter#192173

*If you had to change anything in the [flutter/tests] repo, include a
link to the migration guide as per the [breaking change policy].*

## Pre-launch Checklist

- [x] I read the [Contributor Guide] and followed the process outlined
there for submitting PRs.
- [x] I read the [AI contribution guidelines] and understand my
responsibilities, or I am not using AI tools.
- [x] I read the [Tree Hygiene] wiki page, which explains my
responsibilities.
- [x] I read and followed the [Flutter Style Guide], including [Features
we expect every widget to implement].
- [x] I signed the [CLA].
- [x] I listed at least one issue that this PR fixes in the description
above.
- [ ] I updated/added relevant in-code documentation (doc comments with
`///`).
- [ ] If this PR introduces a new feature or capability, I created and
linked a website documentation issue or PR in [flutter/website] (or
verified none is needed).
- [ ] I added new tests to check the change I am making, or this PR is
[test-exempt].
- [ ] I followed the [breaking change policy] and added [Data Driven
Fixes] where supported.
- [ ] All existing and new tests are passing.

If you need help, consider asking for advice on the #hackers-new channel
on [Discord].

If this change needs to override an active code freeze, provide a
comment explaining why. The code freeze workflow can be overridden by
code reviewers. See pinned issues for any active code freezes with
guidance.

**Note**: The Flutter team is currently trialing the use of [Gemini Code
Assist for
GitHub](https://developers.google.com/gemini-code-assist/docs/review-github-code).
Comments from the `gemini-code-assist` bot should not be taken as
authoritative feedback from the Flutter team. If you find its comments
useful you can update your code accordingly, but if you are unsure or
disagree with the feedback, please feel free to wait for a Flutter team
member's review for guidance on which automated comments should be
addressed.

<!-- Links -->
[Contributor Guide]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#overview
[AI contribution guidelines]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#ai-contribution-guidelines
[Tree Hygiene]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md
[test-exempt]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#tests
[Flutter Style Guide]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md
[Features we expect every widget to implement]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md#features-we-expect-every-widget-to-implement
[CLA]: https://cla.developers.google.com/
[flutter/tests]: https://github.com/flutter/tests
[flutter/website]: https://github.com/flutter/website
[breaking change policy]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#handling-breaking-changes
[Discord]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Chat.md
[Data Driven Fixes]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Data-driven-Fixes.md
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CICD Run CI/CD team-ios Owned by iOS platform team

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants