Skip to content

[patch][engg]: Adopt UIScene lifecycle in 3 iOS host app targets for iOS 27 - #3067

Open
mipetriu wants to merge 2 commits into
devfrom
mipetriu-msal-hostapps-uiscene
Open

[patch][engg]: Adopt UIScene lifecycle in 3 iOS host app targets for iOS 27#3067
mipetriu wants to merge 2 commits into
devfrom
mipetriu-msal-hostapps-uiscene

Conversation

@mipetriu

Copy link
Copy Markdown
Contributor

Migrate the unit-test-host, MSAL Test Automation (iOS), and MSAL Test App (iOS) targets to the UIScene lifecycle for iOS 27 SDK readiness. Each target gets its own scene delegate class and scene manifest entry:

  • unit-test-host: MSALUnitTestHostSceneDelegate (storyboard-driven).
  • MSAL Test Automation (iOS): MSALAutoSceneDelegate, forwards scene:openURLContexts: to the app delegate so MSAL redirect completion works.
  • MSAL Test App (iOS): MSALTestAppSceneDelegate owns the programmatic UITabBarController window (moved out of didFinishLaunchingWithOptions) and forwards scene:openURLContexts:.

Source-only migration; not built.

PR Checklist (must be completed before review)

  • All tests pass locally
  • PR size is <= 500 LOC per PR Size Check policy
  • PR is independently mergeable (no hidden dependencies)
  • Appropriate reviewers are assigned
  • PR reviewed by code owner (required if Copilot-generated)
  • SME or Senior IC assigned where required

PR Title Format

Required Format: [Keyword1] [Keyword2]: Description

  • Keyword1: major, minor, or patch (case-insensitive)
  • Keyword2: feature, bugfix, engg, or tests (case-insensitive)

Examples:

  • [MAJOR] [Feature]: new API
  • [minor] [bugfix]: fix crash
  • [PATCH] [tests]: add coverage

Proposed changes

Describe what this PR is trying to do.

Type of change

  • Feature work
  • Bug fix
  • Documentation
  • Engineering change
  • Test
  • Logging/Telemetry

Risk

  • High – Errors could cause MAJOR regression of many scenarios. (Example: new large features or high level infrastructure changes)
  • Medium – Errors could cause regression of 1 or more scenarios. (Example: somewhat complex bug fixes, small new features)
  • Small – No issues are expected. (Example: Very small bug fixes, string changes, or configuration settings changes)

Additional information

Migrate the unit-test-host, MSAL Test Automation (iOS), and MSAL Test App
(iOS) targets to the UIScene lifecycle for iOS 27 SDK readiness. Each target
gets its own scene delegate class and scene manifest entry:

- unit-test-host: MSALUnitTestHostSceneDelegate (storyboard-driven).
- MSAL Test Automation (iOS): MSALAutoSceneDelegate, forwards
  scene:openURLContexts: to the app delegate so MSAL redirect completion works.
- MSAL Test App (iOS): MSALTestAppSceneDelegate owns the programmatic
  UITabBarController window (moved out of didFinishLaunchingWithOptions) and
  forwards scene:openURLContexts:.

Source-only migration; not built.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 9cd3814b-17a8-49fc-82cc-071fd044427c
Copilot AI review requested due to automatic review settings July 31, 2026 23:58
@mipetriu
mipetriu requested review from a team as code owners July 31, 2026 23:58
@mipetriu
mipetriu requested review from josephpab and swasti29 July 31, 2026 23:58
@@ -470,6 +470,7 @@
962E37E01E720E4F00DE71FE /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 962E37D41E720E4F00DE71FE /* Images.xcassets */; };

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

This pull request does not update CHANGELOG.md.

Please consider if this change would be noticeable to a partner or user and either update CHANGELOG.md or resolve this conversation.

Copilot AI 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.

Pull request overview

Migrates three iOS host app targets (unit-test-host, MSAL iOS automation app, MSAL iOS test app) to the UIScene lifecycle to improve readiness for the iOS 27 SDK, by introducing per-target UIWindowSceneDelegate implementations and updating each target’s Info.plist scene manifest.

Changes:

  • Added new scene delegate classes for unit-test-host, MSAL test automation (iOS), and MSAL test app (iOS).
  • Updated the three iOS targets’ Info.plists to use UIApplicationSceneManifest / UISceneConfigurations (and storyboard binding where applicable).
  • Moved MSAL Test App (iOS) window/root controller setup from application:didFinishLaunchingWithOptions: into the new scene delegate, and added URL-forwarding from scene delegate to app delegate.

Reviewed changes

Copilot reviewed 11 out of 11 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
MSAL/test/unit/ios/unit-test-host/MSALUnitTestHostSceneDelegate.m Adds a storyboard-driven scene delegate stub for the unit-test host.
MSAL/test/unit/ios/unit-test-host/MSALUnitTestHostSceneDelegate.h Declares the unit-test host scene delegate and window property.
MSAL/test/unit/ios/unit-test-host/Info.plist Switches unit-test host to a scene manifest and binds the storyboard to the scene.
MSAL/test/automation/ios/resources/Info.plist Switches MSAL iOS automation target to a scene manifest and binds the storyboard to the scene.
MSAL/test/automation/ios/MSALAutoSceneDelegate.m Adds automation scene delegate and forwards openURLContexts to the app delegate.
MSAL/test/automation/ios/MSALAutoSceneDelegate.h Declares the automation scene delegate and window property.
MSAL/test/app/ios/resources/Info.plist Adds a scene manifest pointing to MSALTestAppSceneDelegate (programmatic window).
MSAL/test/app/ios/MSALTestAppSceneDelegate.m Adds scene-based window setup and forwards openURLContexts to the app delegate.
MSAL/test/app/ios/MSALTestAppSceneDelegate.h Declares the test app scene delegate and window property.
MSAL/test/app/ios/MSALTestAppDelegate.m Removes window/root VC setup from app delegate in favor of the scene delegate.
MSAL/MSAL.xcodeproj/project.pbxproj Registers new scene delegate sources/refs in the Xcode project and target build phases.

Comment thread MSAL/test/automation/ios/MSALAutoSceneDelegate.m
Comment thread MSAL/test/app/ios/MSALTestAppSceneDelegate.m
…ates

Forward connectionOptions.URLContexts from scene:willConnectToSession:
to scene:openURLContexts: so redirect URLs delivered on a cold launch
are not dropped. Addresses PR #3067 review feedback.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 9cd3814b-17a8-49fc-82cc-071fd044427c
Copilot AI review requested due to automatic review settings August 1, 2026 00:31

Copilot AI 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.

Pull request overview

Copilot reviewed 11 out of 11 changed files in this pull request and generated no new comments.

Suppressed comments (2)

MSAL/test/app/ios/MSALTestAppSceneDelegate.m:110

  • Issue: The URL forwarding from scene:openURLContexts: to application:openURL:options: only forwards UIApplicationOpenURLOptionsSourceApplicationKey.
    Impact: Other standard open-URL options (annotation/openInPlace) are silently dropped, which can lead to inconsistent behavior between scene-based and non-scene lifecycles.
    Recommendation: Populate the options dictionary with the full set of values available on UIOpenURLContext.options.
        NSMutableDictionary<UIApplicationOpenURLOptionsKey, id> *options = [NSMutableDictionary new];

        if (context.options.sourceApplication)
        {
            options[UIApplicationOpenURLOptionsSourceApplicationKey] = context.options.sourceApplication;

MSAL/test/automation/ios/MSALAutoSceneDelegate.m:64

  • Issue: When forwarding scene:openURLContexts: to the app delegate, the constructed options dictionary only includes UIApplicationOpenURLOptionsSourceApplicationKey.
    Impact: This drops other standard URL open options (e.g. annotation/openInPlace) and can break redirects or future handlers that depend on them.
    Recommendation: Forward the full set of available UIOpenURLContext.options values when present.
        NSMutableDictionary<UIApplicationOpenURLOptionsKey, id> *options = [NSMutableDictionary new];

        if (context.options.sourceApplication)
        {
            options[UIApplicationOpenURLOptionsSourceApplicationKey] = context.options.sourceApplication;


- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
// Window and root view controller are set up by MSALTestAppSceneDelegate in the UIScene lifecycle.

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.

The window property on the app delegate is dead now - nothing assigns it and UIKit doesn't populate it under the scene lifecycle, so it'll always be nil. Worth removing it from MSALTestAppDelegate.h (and the automation / unit-test-host app delegates) so nobody wires up to it later.

@kaisong1990

Copy link
Copy Markdown
Contributor

Scope question: Samples/ios/SampleApp and Samples/ios/SampleAppiOS-Swift are still delegate-only, no scene manifest. Same iOS 27 problem applies there and those are what customers copy from. Follow-up PR, or intentionally out of scope here?

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