Repository navigation
Conversation
|
🤖 Your Docs stage site is ready! Visit it here: https://unodocsprstaging.z13.web.core.windows.net/pr-25687/docs/index.html |
|
🤖 Your WebAssembly Sample App stage site is ready! Visit it here: |
|
The build 241259 found UI Test snapshots differences: Details
|
|
|
baa6e6d to
a49bb2d
Compare
|
🤖 Your Docs stage site is ready! Visit it here: https://unodocsprstaging.z13.web.core.windows.net/pr-25687/docs/index.html |
|
🤖 Your WebAssembly Sample App stage site is ready! Visit it here: |
|
The build 241265 found UI Test snapshots differences: Details
|
|
|
|
🤖 Your Docs stage site is ready! Visit it here: https://unodocsprstaging.z13.web.core.windows.net/pr-25687/docs/index.html |
|
🤖 Your WebAssembly Sample App stage site is ready! Visit it here: |
|
🤖 Your Docs stage site is ready! Visit it here: https://unodocsprstaging.z13.web.core.windows.net/pr-25687/docs/index.html |
|
🤖 Your WebAssembly Sample App stage site is ready! Visit it here: |
|
The build 241383 found UI Test snapshots differences: Details
|
|
|
7926541 to
3406657
Compare
|
🤖 Your WebAssembly Sample App stage site is ready! Visit it here: |
|
🤖 Your Docs stage site is ready! Visit it here: https://unodocsprstaging.z13.web.core.windows.net/pr-25687/docs/index.html |
|
The build 241450 found UI Test snapshots differences: Details
|
Apps built with the version 27 SDKs must use the UIKit scene lifecycle, or iOS and tvOS 27 refuse to launch them. Apps without a scene manifest stayed on the app lifecycle, so an existing app upgraded to 7.0 crashed at launch. Uno now adopts the scene lifecycle for those apps when they are built with a version 27 SDK, or when UnoUseSceneLifecycle is set in Info.plist, and logs at startup which lifecycle the app runs and what decided it. The application scene gets the internal AdoptedSceneDelegate, whose Objective-C name is fixed and shared with 6.8, as UIKit restores saved scene sessions with it. AdoptedSceneBinder hosts the app's single window, created up front as before, in that scene: a scene that connects before the window exists is held for it, and a disconnect keeps the window for the next scene instead of closing it. The URL, user activity, shortcut, and foreground and background callbacks UIKit now sends to the scene are forwarded to the application delegate, each guarded on its own, so that its overrides keep working. Apps with a manifest keep UnoUISceneDelegate, which is also assigned when the manifest names no delegate class. In every mode, a window now ignores native visibility changes until it is shown, so that Show() raises the first VisibilityChanged, a failing UIKit callback is logged with its name as well as raised as an unhandled exception, and a scene role the bindings don't know no longer throws. Refs unoplatform#25510 Claude-Session: https://claude.ai/code/session_01DtUZ4zXC6g5yoXN9Rdt2yx
One test checks the window is hosted by its scene's delegate. A second opens the SamplesApp's own URL scheme and checks the activation is reported; tvOS doesn't open an app's own URL, so it runs on iOS. Refs unoplatform#25510 Claude-Session: https://claude.ai/code/session_01DtUZ4zXC6g5yoXN9Rdt2yx
The scene logging read typeof(T).Log() for both the level check and the call, and each read takes the logger factory's lock. The logger is now kept in a local variable. A scene role the bindings don't know now logs the whole exception instead of its message. Claude-Session: https://claude.ai/code/session_01DtUZ4zXC6g5yoXN9Rdt2yx
3406657 to
7109271
Compare
|
🤖 Your Docs stage site is ready! Visit it here: https://unodocsprstaging.z13.web.core.windows.net/pr-25687/docs/index.html |
|
🤖 Your WebAssembly Sample App stage site is ready! Visit it here: |
|
The build 241515 found UI Test snapshots differences: Details
|
Xiaoy312
left a comment
There was a problem hiding this comment.
The adopted-scene path is the fix for #25510, but CI never runs it: both SamplesApp heads declare a manifest, so the two new tests exercise UnoUISceneDelegate. The 6.8 counterpart sets UnoUseSceneLifecycle on one head for exactly this reason. Could the tvOS head drop the manifest added in #25661? It sets UIApplicationSupportsMultipleScenes=false and only existed to launch on Xcode 27, which this PR now handles. Separately, making Decide() a pure function of (manifest, key value, SDK version) would let a unit test cover the decision cases.
The tvOS SamplesApp has declared a scene manifest since unoplatform#25661, so neither head ran the scene lifecycle Uno adopts for apps without one, which is the fix for unoplatform#25510. The tvOS head now has no manifest and sets UnoUseSceneLifecycle, as CI still builds it with an SDK older than 27, so its runtime tests run under the adopted scene delegate. The scene test also fails, instead of carrying on as if the app used the scene lifecycle, when it can't find UsesSceneLifecycle, for instance once trimmed. Refs unoplatform#25510 Claude-Session: https://claude.ai/code/session_01DtUZ4zXC6g5yoXN9Rdt2yx
The SamplesApp shows a dialog for an activation into the running app, which on iOS is a native alert that CloseAllPopups doesn't close. The URL test now opens a runtime-tests URL, for which the SamplesApp shows none. Refs unoplatform#25510 Claude-Session: https://claude.ai/code/session_01DtUZ4zXC6g5yoXN9Rdt2yx
The decision now lives in AppleUIKitLifecycleDecision, a pure function of the scene manifest's presence, UnoUseSceneLifecycle and the SDK version. It has no Apple types, so Uno.UI.UnitTests links it like the other runtime helpers and tests the decision table. Refs unoplatform#25510 Claude-Session: https://claude.ai/code/session_01DtUZ4zXC6g5yoXN9Rdt2yx
UIKit normally moves a scene to the background before disconnecting it. A scene that disconnects without doing so, such as one connected by a background launch, left the app counted as in the foreground, so the next scene entering the foreground wasn't forwarded to the application delegate. Checked by review only, as the simulator can't produce that order on demand. Refs unoplatform#25510 Claude-Session: https://claude.ai/code/session_01DtUZ4zXC6g5yoXN9Rdt2yx
UIKit restores a scene session with the delegate it was saved with, but on the iOS 27 simulator it didn't reuse it once an app update added or removed a scene manifest, whatever the configuration name. If it ever does, the adopted scene delegate connects in a lifecycle where nothing gives it the window, so it now logs an error. Refs unoplatform#25510 Claude-Session: https://claude.ai/code/session_01DtUZ4zXC6g5yoXN9Rdt2yx
|
Thanks for the review. Both points are in:
I've updated the PR description to match. |
|
🤖 Your WebAssembly Sample App stage site is ready! Visit it here: |
|
The build 241682 found UI Test snapshots differences: Details
|
|
/azp run Uno.UI - docs |
|
Azure Pipelines successfully started running 1 pipeline(s). |
|
This pull request does not currently match the merge queue conditions, so it cannot be queued from here. The box comes back if it matches again. |
|
🤖 Your Docs stage site is ready! Visit it here: https://unodocsprstaging.z13.web.core.windows.net/pr-25687/docs/index.html |
GitHub Issue: closes #25510
PR Type:
🐞 Bugfix
What changed? 🚀
Apps built with the version 27 SDKs (Xcode 27) must use the UIKit scene lifecycle, or iOS and tvOS 27 refuse to launch them:
UIScene life cycle is required for apps built with this SDK. On master, only apps that declare aUIApplicationSceneManifestgot the scene lifecycle. Apps without a manifest, which includes every existing app upgraded to 7.0, stayed on the app lifecycle and crashed at launch. Thanks to @mikernet for reporting this and pointing out the gap in master.This PR adds a third lifecycle mode for apps without a manifest, next to the existing app lifecycle and manifest modes:
DTPlatformVersion≥ 27), whatever its .NET version, or when the SDK version can't be read.UnoUseSceneLifecycleInfo.plist key overrides that in either direction.UnoUIApplicationDelegate.GetConfigurationassigns the new internalAdoptedSceneDelegateto the application scene. Other roles, such as an external display, get no delegate, so UIKit keeps mirroring them.AdoptedSceneBinderhosts the app's single window in that scene. The window is still created up front, as under the app lifecycle.UnoUISceneDelegateis unchanged for apps with a manifest. It's now also assigned when the manifest names no delegate class, as Uno 6.8 does.AdoptedSceneDelegateis registered asUnoAdoptedSceneDelegate, the same name as the 6.8 fix. UIKit restores a saved scene session with the delegate class it was saved with, without callingGetConfiguration. When testing this PR, a build whose saved session named a class that exists but is the wrong delegate never got its window into a scene. Adding or removing a manifest in an app update doesn't run into this: on the iOS 27 simulator, UIKit then didn't reuse the saved class, whatever the manifest's configuration name.AdoptedSceneDelegatelogs an error if it ever connects outside its mode.OpenUrl,ContinueUserActivity,PerformActionForShortcutItem,OnActivatedandDidEnterBackgroundkeep working.AppleUIKitLifecycleand the pureAppleUIKitLifecycleDecision.AppleUIKitLifecyclelogs at startup which lifecycle the app runs and what decided it. It warns whenUnoUseSceneLifecycleis neither a boolean nor a number, or the SDK version is unknown.Show()raises the firstVisibilityChanged.Errorwith its name, and still raised as an unhandled exception.Given_Window.When_Scene_Lifecycle_Window_Hosted_In_Application_Scenechecks the scene's delegate hosts the window. It's inconclusive under the app lifecycle.Given_Window.When_Url_Opened_Then_Activation_Reportedopens the SamplesApp's own URL scheme and waits forAppInstance.Activated. It's inconclusive on tvOS, which doesn't open an app's own URL. The SamplesApp shows no activation dialog for the URL'sruntime-testshost.Given_AppleUIKitLifecycleDecision(unit tests) covers the decision: the manifest first, then the key, then the SDK version, including versions it can't read.UnoUseSceneLifecycle, as CI still builds with Xcode 26.6, so CI's tvOS runtime tests run underAdoptedSceneDelegate.customizing-uiapplicationdelegate.md: new Scene lifecycle section, including how to see the startup log.migrating-to-uno-7.md: the switch comes with the move to Xcode 27, not with the upgrade to 7.0.protocol-activation.md: under the scene lifecycle, a cold-start activation arrives afterOnLaunched.windows-ui-xaml-window.md: small update.The 6.8 counterpart is #25688.
The tvOS SamplesApp failed to launch on the xcode-27 runner (#25659) for the same reason (#25660). #25661 fixed that for the SamplesApp by giving it a scene manifest. This PR fixes it for apps that don't have one, and takes the tvOS SamplesApp's manifest back out so that CI runs that path.
Validation
net10.0-ios) and the tvOS one (net10.0-tvos) build.Uno.UI.UnitTestsbuilds, with analyzers on for the test project.MtouchLink=Fullas on CI, builds.net11.0TFMs, since that SDK isn't available on the test machine.Given_AppleUIKitLifecycleDecisioncases pass. They ran on macOS, with the macOS ICU libraries copied into the output, which the test project only bundles for Windows.Given_Windowhas no failures with and without a manifest, in Debug and in the trimmed Release build.Given_Windowhas no failures without a manifest, with one, and with one that names no delegate class.UnoUseSceneLifecycle=falsestill fails to launch, as UIKit requires.OnSuspending, thenOnResuming.awaitinOnLaunchedappears (checked beforeAdoptedSceneDelegatewas split out).Default Configuration.UnoUseSceneLifecycle=false):Given_Windowmatches, and the scene test is inconclusive.OnSuspending/OnResumingare raised in the same order in both (checked before the split).Given_Windowhas no failures. Before the rebase onto fix(samplesapp): Adopt the scene lifecycle on tvOS #25661, this branch's tvOS head had the same setup and all four CI tvOS shards passed.UnoAdoptedSceneDelegateis registered, and both tests pass in both modes.Not validated yet
Open question for reviewers
The mode follows the SDK the app is built with. The alternative is to always adopt the scene lifecycle in 7.0, which would take the app lifecycle path out of play but change behavior for apps still built with Xcode 26.
Known, out of scope
awaitinOnLaunchedshows a black screen ([iOS] Launch scene is destroyed when the initial Window is created after an await in OnLaunched #24812, reproduced while testing this PR).WillEnterForegroundor raiseResuming, unlike the app lifecycle.PR Checklist ✅
Screenshots Compare Test Runresults.No API changes. The behavior only changes for apps built with a version 27 SDK, which couldn't launch before. For those, the launch URL, shortcut or user activity is no longer in
FinishedLaunching's launch options; it reaches the forwarded overrides afterOnLaunchedinstead. This is documented in the migration guide.🤖 Generated with Claude Code
https://claude.ai/code/session_01DtUZ4zXC6g5yoXN9Rdt2yx