Repository navigation
Description
Current behavior 🐛
Found by code review; not reproduced on a device yet.
Under the scene lifecycle (an app with UIApplicationSceneManifest), the launch scene is destroyed if the initial Window doesn't exist yet when UIKit calls scene:willConnectToSession:options:.
Binding only works one way, with the window waiting for the scene:
NativeWindowFactoryExtension.CreateWindowregisters the window wrapper inSceneWindowRegistry.UnoUISceneDelegate.WillConnectcallsSceneWindowRegistry.TryTake(...). If nothing is registered, it callsRequestSceneSessionDestructionand returns.
This only works today because Application.Start calls OnLaunched synchronously on iOS. So an app that creates its window after an await loses its launch scene:
protected override async void OnLaunched(LaunchActivatedEventArgs args)
{
await InitializeAsync(); // UIKit connects the launch scene here -> nothing registered -> destroyed
MainWindow = new Window();
MainWindow.Activate();
}Related cases that come from the same one-way binding:
- The launch scene never carries the window's GUID, so it is always matched through the "oldest pending window" fallback. A restored or OS-created scene can take a secondary window that is still waiting for its own requested scene.
- Scenes the app didn't request (iPad "New Window" in the app switcher, drag to split view, sessions restored beyond the initial window) are always discarded instead of reaching the app as an activation.
Expected behavior 🎯
A launch scene that connects before the initial Window is created should be held until that window exists, then bound to it. The app should show its UI no matter how OnLaunched is written.
How to reproduce it (as minimally and precisely as possible) 🔬
- Create an Uno app with an iOS head that opts into the scene lifecycle: a
UIApplicationSceneManifestin Info.plist plus aUnoUISceneDelegatesubclass (see SamplesAppPlatforms/iOS/SceneDelegate.iOS.cs). - In
OnLaunched,await Task.Delay(100);beforenew Window(). - Run on the iPad simulator.
- Expected: the app's UI. Suspected actual: the log shows
No window is awaiting a scene ... discarding the session, and no UI appears.
Workaround 🛠️
Create the initial Window synchronously at the start of OnLaunched, before any await.
Renderer 🎨
- Skia
- Native
Affected platforms 📱💻🖥️
iOS
Uno.Sdk version (and other relevant versions) 📦
master (after #19082)
IDE version 🧑💻
N/A
Anything else we need to know? 💬
The proposed redesign that fixes this is in the linked enhancement issue. Related: #19082, #8341.
Activity
MartinZikmund commentedon Sep 29, 2026
Proposed fix: #24814