[patch][engg]: Adopt UIScene lifecycle in 3 iOS host app targets for iOS 27 - #3067
[patch][engg]: Adopt UIScene lifecycle in 3 iOS host app targets for iOS 27#3067mipetriu wants to merge 2 commits into
Conversation
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
| @@ -470,6 +470,7 @@ | |||
| 962E37E01E720E4F00DE71FE /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 962E37D41E720E4F00DE71FE /* Images.xcassets */; }; | |||
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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. |
…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
There was a problem hiding this comment.
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:toapplication:openURL:options:only forwardsUIApplicationOpenURLOptionsSourceApplicationKey.
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 theoptionsdictionary with the full set of values available onUIOpenURLContext.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 constructedoptionsdictionary only includesUIApplicationOpenURLOptionsSourceApplicationKey.
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 availableUIOpenURLContext.optionsvalues 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. |
There was a problem hiding this comment.
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.
|
Scope question: |
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:
Source-only migration; not built.
PR Checklist (must be completed before review)
PR Title Format
Required Format:
[Keyword1] [Keyword2]: Descriptionmajor,minor, orpatch(case-insensitive)feature,bugfix,engg, ortests(case-insensitive)Examples:
[MAJOR] [Feature]: new API[minor] [bugfix]: fix crash[PATCH] [tests]: add coverageProposed changes
Describe what this PR is trying to do.
Type of change
Risk
Additional information