From 923914f845e568e535e6bb55b9f5d3c993e25bfd Mon Sep 17 00:00:00 2001 From: Rolf Bjarne Kvinge Date: Tue, 20 Oct 2026 18:06:28 +0200 Subject: [PATCH 1/7] Document UIKit scene lifecycle migration for SDK 27 apps Add an iOS and Mac Catalyst migration guide with the matching registered MauiUISceneDelegate and scene manifest configuration. Explain the SDK-based launch requirement separately from deployment targets, and cover existing custom configurations, scene lifecycle callbacks, cold-start links, authentication and app actions. Document MT7198, the ValidateSceneManifest opt-out and the limits of manifest-only validation. Include concrete guidance for AI agents and a migration verification checklist, and make the page discoverable from the iOS table of contents. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> --- docs/TOC.yml | 2 + docs/ios/uikit-scene-lifecycle.md | 153 ++++++++++++++++++++++++++++++ 2 files changed, 155 insertions(+) create mode 100644 docs/ios/uikit-scene-lifecycle.md diff --git a/docs/TOC.yml b/docs/TOC.yml index 01b145908e..e194630d02 100644 --- a/docs/TOC.yml +++ b/docs/TOC.yml @@ -967,6 +967,8 @@ href: ios/apple-account-management.md - name: Apple privacy manifest href: ios/privacy-manifest.md + - name: Migrate to the UIKit scene lifecycle + href: ios/uikit-scene-lifecycle.md - name: Build apps items: - name: Build targets diff --git a/docs/ios/uikit-scene-lifecycle.md b/docs/ios/uikit-scene-lifecycle.md new file mode 100644 index 0000000000..d0a2b59f41 --- /dev/null +++ b/docs/ios/uikit-scene-lifecycle.md @@ -0,0 +1,153 @@ +--- +title: "Migrate to the UIKit scene lifecycle" +description: Learn how to migrate a .NET MAUI app on iOS and Mac Catalyst to the UIKit scene-based lifecycle, which is required when building with the iOS 27 / Mac Catalyst 27 SDK (Xcode 27). +ms.date: 10/20/2026 +no-loc: [ "UIScene", "SceneDelegate", "AppDelegate" ] +--- + +# Migrate to the UIKit scene lifecycle + +Apps built against the iOS 27 and Mac Catalyst 27 SDK (Xcode 27) must use the UIKit scene-based lifecycle. An app that still uses the legacy `UIApplicationDelegate`-only lifecycle crashes at launch when it's built with Xcode 27 and run on iOS 27 or Mac Catalyst 27. For more information, see [TN3187: Migrating to the UIKit scene-based life cycle](https://developer.apple.com/documentation/technotes/tn3187-migrating-to-the-uikit-scene-based-life-cycle) on developer.apple.com. + +Apps created from .NET MAUI project templates before the fix don't contain the required scene configuration, and updating the .NET MAUI NuGet packages doesn't add it to existing `Platforms/iOS` and `Platforms/MacCatalyst` files. You have to make the change in your project. + +> [!IMPORTANT] +> This requirement is tied to the **SDK you build with** (Xcode 27 / iOS 27 SDK), not to the **minimum OS version you deploy to**. Adopt scenes before you build with Xcode 27, even if your app still supports older operating systems. Raising `SupportedOSPlatformVersion` doesn't fix a missing scene lifecycle. + +## Before you start + +Use a .NET for iOS and Mac Catalyst workload that supports your selected Xcode version. Independently of scene adoption, the .NET 27 SDKs require a minimum deployment target of iOS 15.0 and Mac Catalyst 17.0 (macOS 14). Keep a higher deployment target if your app already requires one. If you must support older operating systems, use a compatible older SDK rather than silently dropping those users. + +Check the project's `global.json`, .NET MAUI package versions, and any configuration-specific `Info.plist` paths before editing. Apply the migration to every configuration that can produce a shipping app, including separate iOS and Mac Catalyst app projects. + +## Quick fix for most apps + +Do the following for **both** `Platforms/iOS` and `Platforms/MacCatalyst` (skip a platform your app doesn't target). Keep your existing `AppDelegate`. + +1. Add a `SceneDelegate.cs` file to the platform folder: + + ```csharp + using Foundation; + using Microsoft.Maui; + + namespace MyApp; + + [Register("SceneDelegate")] + public class SceneDelegate : MauiUISceneDelegate + { + } + ``` + + Use your app's namespace. The class must be `public` and registered as `SceneDelegate`, which is the name referenced by `Info.plist`. If you already have a custom scene delegate, preserve its registration and behavior instead of adding a competing delegate. + +1. Add the `UIApplicationSceneManifest` entry to the root `` of the platform's `Info.plist`. If the key already exists, reconcile its configuration with the scene delegate instead of adding a duplicate: + + ```xml + UIApplicationSceneManifest + + UIApplicationSupportsMultipleScenes + + UISceneConfigurations + + UIWindowSceneSessionRoleApplication + + + UISceneConfigurationName + __MAUI_DEFAULT_SCENE_CONFIGURATION__ + UISceneDelegateClassName + SceneDelegate + + + + + ``` + + Keep `__MAUI_DEFAULT_SCENE_CONFIGURATION__` exactly as shown for the default .NET MAUI window-creation path. Match `UISceneDelegateClassName` to the delegate's `[Register]` name. Supporting multiple windows is optional; keep `UIApplicationSupportsMultipleScenes` set to `false` unless the app supports them. + + Don't add `UISceneStoryboardFile`; .NET MAUI creates the window in code. Preserve existing splash-screen and launch-storyboard settings. + +1. Build and run the app, then verify the behavior described in [Test the migration](#test-the-migration). + +### How it works + +When `UIApplicationSceneManifest` is present, `MauiUIApplicationDelegate` selects scene-based startup and returns the `__MAUI_DEFAULT_SCENE_CONFIGURATION__` scene configuration. `MauiUISceneDelegate` then creates the scene-backed window for your app. For details, see the [.NET MAUI pull request that updated the templates to use scenes](https://github.com/dotnet/maui/pull/38601). + +## Update .NET MAUI + +Use .NET MAUI 10.0.110 or later. It includes scene forwarding for features such as app actions and `WebAuthenticator`. If you're already on a newer version, don't downgrade. See [Migrate .NET MAUI apps to the UIKit scene lifecycle](https://devblogs.microsoft.com/dotnet/migrate-dotnet-maui-apps-uikit-scene-lifecycle/) for details. + +## Preserve existing customizations + +If your app already customizes startup, don't overwrite it blindly. + +- **Existing `UIApplicationSceneManifest`**: preserve working scene configurations and any custom `SceneDelegate` subclass. Review custom configuration names together with `GetConfiguration` and `WillConnect` overrides: names other than `__MAUI_DEFAULT_SCENE_CONFIGURATION__` need custom window creation. +- **Custom `SceneDelegate` overrides**: always call the `base` implementation. +- **Application-level lifecycle callbacks**: with scenes, lifecycle events and URL/activity handling move to scene-level events. If you register lifecycle events through `ConfigureLifecycleEvents`, move these registrations: + + | Legacy (application) event | Scene event | + |----------------------------|-----------------------------| + | `OnActivated` | `SceneOnActivated` | + | `OnResignActivation` | `SceneOnResignActivation` | + | `DidEnterBackground` | `SceneDidEnterBackground` | + | `WillEnterForeground` | `SceneWillEnterForeground` | + | `OpenUrl` | `SceneOpenUrl` | + | `ContinueUserActivity` | `SceneContinueUserActivity` | + + The callback arguments differ from the application-level versions, so review each handler rather than renaming it. + + ```csharp + builder.ConfigureLifecycleEvents(events => + { + #if IOS || MACCATALYST + events.AddiOS(ios => ios + .SceneOnActivated((scene) => { /* ... */ }) + .SceneOpenUrl((scene, urlContexts) => { /* ... */ })); + #endif + }); + ``` + +- **Cold-start deep links and activities**: URLs and user activities that launch the app arrive in the connection options of `SceneWillConnect`, not through the warm scene URL/activity callbacks. Handle these connection options in addition to the warm callbacks. Review notification-tap and authentication handling separately, preserving the relevant notification delegate and authentication-session completion callbacks. +- **Dynamic scene configuration**: Apple also supports returning a configuration from `UIApplicationDelegate.application(_:configurationForConnecting:options:)` instead of declaring it in `Info.plist`. This is valid. The build-time check described below accepts an empty `UIApplicationSceneManifest` dictionary for this case, so add an empty one (or opt out of the check) if you configure scenes dynamically. + +## Build-time check + +When building for iOS or Mac Catalyst against SDK 27 or later, the build checks that the app's final merged `Info.plist` contains a `UIApplicationSceneManifest` dictionary, and reports error **MT7198** if it's missing or isn't a dictionary. An empty dictionary is accepted, which supports dynamic scene configuration. App extensions, frameworks, and libraries are skipped. + +The error message reads: "The app's Info.plist does not contain a UIApplicationSceneManifest dictionary. Apps built with the iOS or Mac Catalyst 27.0 SDK or later must use the UIKit scene lifecycle or they will crash at launch on iOS or macOS 27.0 or later. Add a scene manifest and scene delegate, and migrate custom lifecycle handlers as described at https://aka.ms/uiscene. To skip this build-time validation, set the MSBuild property ValidateSceneManifest to false; this does not disable the operating system's requirement." + +The check is a heuristic on the manifest. It doesn't prove that your scene delegate or window is wired up correctly. To skip the check, opt out in the project file: + +```xml + + false + +``` + +or on the command line: `-p:ValidateSceneManifest=false`. Opting out doesn't prevent the launch crash on iOS 27 / Mac Catalyst 27. + +## Instructions for AI agents + +If you're an AI agent resolving error MT7198 in a .NET MAUI app: + +1. Find the `Platforms/iOS/Info.plist` and `Platforms/MacCatalyst/Info.plist` files for each platform the project targets (check `TargetFrameworks`). +1. If `UIApplicationSceneManifest` is missing, add it as shown in [Quick fix for most apps](#quick-fix-for-most-apps). If it exists, reconcile it with the registered delegate and window-creation code rather than replacing custom configurations or adding duplicate keys. +1. Add `SceneDelegate.cs` (derived from `MauiUISceneDelegate`, `[Register("SceneDelegate")]`, public) to each platform folder unless a suitable registered scene delegate already exists. Preserve existing custom delegate names and behavior, and match the manifest to the registered name. Keep `AppDelegate`. +1. Search the app for application-level lifecycle registrations and `AppDelegate` overrides (`OpenUrl`, `ContinueUserActivity`, `DidEnterBackground`, and so on) and migrate them as described in [Preserve existing customizations](#preserve-existing-customizations). +1. Don't change `SupportedOSPlatformVersion` merely to fix scene adoption, don't silently drop support for older operating systems, and don't downgrade .NET MAUI. Check the selected workload's independent deployment-target requirements. +1. Only set `ValidateSceneManifest` to `false` (or add an empty manifest dictionary) if scenes are configured dynamically, and tell the developer. + +## Test the migration + +Test Debug and Release builds on iOS 27 / Mac Catalyst 27 and on the oldest OS version your app supports: + +- Cold launch and warm launch. +- Foreground and background transitions. +- Deep links (cold start and while running), universal links, and authentication redirects such as `WebAuthenticator`. +- App actions (home screen quick actions), push notification taps, and any other launch-from-activity scenarios. +- Any custom lifecycle event handlers you migrated. + +## See also + +- [TN3187: Migrating to the UIKit scene-based life cycle](https://developer.apple.com/documentation/technotes/tn3187-migrating-to-the-uikit-scene-based-life-cycle) +- [Migrate .NET MAUI apps to the UIKit scene lifecycle](https://devblogs.microsoft.com/dotnet/migrate-dotnet-maui-apps-uikit-scene-lifecycle/) +- [dotnet/maui pull request 38601](https://github.com/dotnet/maui/pull/38601) From 9ee24b56b7a76513784b4e1c496d3f39fb37fbeb Mon Sep 17 00:00:00 2001 From: Rolf Bjarne Kvinge Date: Tue, 20 Oct 2026 18:21:41 +0200 Subject: [PATCH 2/7] Add scene log message and agent skill pointer to UIKit scene doc Mention the device log message users see when the scene lifecycle is missing, and link to the blog post describing the experimental maui-xcode27-migration agent skill. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> --- docs/ios/uikit-scene-lifecycle.md | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/docs/ios/uikit-scene-lifecycle.md b/docs/ios/uikit-scene-lifecycle.md index d0a2b59f41..1207d4fc16 100644 --- a/docs/ios/uikit-scene-lifecycle.md +++ b/docs/ios/uikit-scene-lifecycle.md @@ -7,7 +7,7 @@ no-loc: [ "UIScene", "SceneDelegate", "AppDelegate" ] # Migrate to the UIKit scene lifecycle -Apps built against the iOS 27 and Mac Catalyst 27 SDK (Xcode 27) must use the UIKit scene-based lifecycle. An app that still uses the legacy `UIApplicationDelegate`-only lifecycle crashes at launch when it's built with Xcode 27 and run on iOS 27 or Mac Catalyst 27. For more information, see [TN3187: Migrating to the UIKit scene-based life cycle](https://developer.apple.com/documentation/technotes/tn3187-migrating-to-the-uikit-scene-based-life-cycle) on developer.apple.com. +Apps built against the iOS 27 and Mac Catalyst 27 SDK (Xcode 27) must use the UIKit scene-based lifecycle. An app that still uses the legacy `UIApplicationDelegate`-only lifecycle crashes at launch when it's built with Xcode 27 and run on iOS 27 or Mac Catalyst 27. The device log contains the message `UIScene life cycle is required for apps built with this SDK.` For more information, see [TN3187: Migrating to the UIKit scene-based life cycle](https://developer.apple.com/documentation/technotes/tn3187-migrating-to-the-uikit-scene-based-life-cycle) on developer.apple.com. Apps created from .NET MAUI project templates before the fix don't contain the required scene configuration, and updating the .NET MAUI NuGet packages doesn't add it to existing `Platforms/iOS` and `Platforms/MacCatalyst` files. You have to make the change in your project. @@ -136,6 +136,10 @@ If you're an AI agent resolving error MT7198 in a .NET MAUI app: 1. Don't change `SupportedOSPlatformVersion` merely to fix scene adoption, don't silently drop support for older operating systems, and don't downgrade .NET MAUI. Check the selected workload's independent deployment-target requirements. 1. Only set `ValidateSceneManifest` to `false` (or add an empty manifest dictionary) if scenes are configured dynamically, and tell the developer. +## Let an AI agent do the migration + +The blog post [Get Your .NET MAUI App Ready for Xcode 27](https://devblogs.microsoft.com/dotnet/migrate-dotnet-maui-apps-uikit-scene-lifecycle/) describes an experimental `maui-xcode27-migration` agent skill, installed with the preview .NET MAUI CLI, that guides a coding agent through this migration. It's preview tooling that isn't covered by the Microsoft Support Policy, and you should review the resulting changes. The manual steps on this page work without it. + ## Test the migration Test Debug and Release builds on iOS 27 / Mac Catalyst 27 and on the oldest OS version your app supports: From a93102137ca31466096440d540e7ad3a2bb3b0c3 Mon Sep 17 00:00:00 2001 From: Rolf Bjarne Kvinge Date: Tue, 20 Oct 2026 18:28:04 +0200 Subject: [PATCH 3/7] Use the C# name for the dynamic scene configuration callback Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> --- docs/ios/uikit-scene-lifecycle.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/ios/uikit-scene-lifecycle.md b/docs/ios/uikit-scene-lifecycle.md index 1207d4fc16..259ca5bad3 100644 --- a/docs/ios/uikit-scene-lifecycle.md +++ b/docs/ios/uikit-scene-lifecycle.md @@ -107,7 +107,7 @@ If your app already customizes startup, don't overwrite it blindly. ``` - **Cold-start deep links and activities**: URLs and user activities that launch the app arrive in the connection options of `SceneWillConnect`, not through the warm scene URL/activity callbacks. Handle these connection options in addition to the warm callbacks. Review notification-tap and authentication handling separately, preserving the relevant notification delegate and authentication-session completion callbacks. -- **Dynamic scene configuration**: Apple also supports returning a configuration from `UIApplicationDelegate.application(_:configurationForConnecting:options:)` instead of declaring it in `Info.plist`. This is valid. The build-time check described below accepts an empty `UIApplicationSceneManifest` dictionary for this case, so add an empty one (or opt out of the check) if you configure scenes dynamically. +- **Dynamic scene configuration**: Apple also supports providing a configuration by overriding `UIApplicationDelegate.GetConfiguration` (`UIApplicationDelegate.application(_:configurationForConnecting:options:)` in Objective-C and Swift) instead of declaring it in `Info.plist`. This is valid. The build-time check described below accepts an empty `UIApplicationSceneManifest` dictionary for this case, so add an empty one (or opt out of the check) if you configure scenes dynamically. ## Build-time check From 2a002ccbd9600df47f610dadabea478e790a9920 Mon Sep 17 00:00:00 2001 From: Rolf Bjarne Kvinge Date: Wed, 21 Oct 2026 10:26:14 +0200 Subject: [PATCH 4/7] Use MT7199 for the scene lifecycle diagnostic MT7198 collided with a newly added codesign diagnostic in macios. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> --- docs/ios/uikit-scene-lifecycle.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/ios/uikit-scene-lifecycle.md b/docs/ios/uikit-scene-lifecycle.md index 259ca5bad3..07a0ef9824 100644 --- a/docs/ios/uikit-scene-lifecycle.md +++ b/docs/ios/uikit-scene-lifecycle.md @@ -111,7 +111,7 @@ If your app already customizes startup, don't overwrite it blindly. ## Build-time check -When building for iOS or Mac Catalyst against SDK 27 or later, the build checks that the app's final merged `Info.plist` contains a `UIApplicationSceneManifest` dictionary, and reports error **MT7198** if it's missing or isn't a dictionary. An empty dictionary is accepted, which supports dynamic scene configuration. App extensions, frameworks, and libraries are skipped. +When building for iOS or Mac Catalyst against SDK 27 or later, the build checks that the app's final merged `Info.plist` contains a `UIApplicationSceneManifest` dictionary, and reports error **MT7199** if it's missing or isn't a dictionary. An empty dictionary is accepted, which supports dynamic scene configuration. App extensions, frameworks, and libraries are skipped. The error message reads: "The app's Info.plist does not contain a UIApplicationSceneManifest dictionary. Apps built with the iOS or Mac Catalyst 27.0 SDK or later must use the UIKit scene lifecycle or they will crash at launch on iOS or macOS 27.0 or later. Add a scene manifest and scene delegate, and migrate custom lifecycle handlers as described at https://aka.ms/uiscene. To skip this build-time validation, set the MSBuild property ValidateSceneManifest to false; this does not disable the operating system's requirement." @@ -127,7 +127,7 @@ or on the command line: `-p:ValidateSceneManifest=false`. Opting out doesn't pre ## Instructions for AI agents -If you're an AI agent resolving error MT7198 in a .NET MAUI app: +If you're an AI agent resolving error MT7199 in a .NET MAUI app: 1. Find the `Platforms/iOS/Info.plist` and `Platforms/MacCatalyst/Info.plist` files for each platform the project targets (check `TargetFrameworks`). 1. If `UIApplicationSceneManifest` is missing, add it as shown in [Quick fix for most apps](#quick-fix-for-most-apps). If it exists, reconcile it with the registered delegate and window-creation code rather than replacing custom configurations or adding duplicate keys. From dd42a7d98c8a12cdf60ff56d936965b93eb4443e Mon Sep 17 00:00:00 2001 From: Rolf Bjarne Kvinge Date: Wed, 21 Oct 2026 13:59:40 +0200 Subject: [PATCH 5/7] Address review comments on scene lifecycle doc Add ai-usage front matter, return a bool from the SceneOpenUrl sample, and require an (at least empty) UIApplicationSceneManifest for dynamic scene configuration. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> --- docs/ios/uikit-scene-lifecycle.md | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/docs/ios/uikit-scene-lifecycle.md b/docs/ios/uikit-scene-lifecycle.md index 07a0ef9824..436c542026 100644 --- a/docs/ios/uikit-scene-lifecycle.md +++ b/docs/ios/uikit-scene-lifecycle.md @@ -1,7 +1,8 @@ --- title: "Migrate to the UIKit scene lifecycle" description: Learn how to migrate a .NET MAUI app on iOS and Mac Catalyst to the UIKit scene-based lifecycle, which is required when building with the iOS 27 / Mac Catalyst 27 SDK (Xcode 27). -ms.date: 10/20/2026 +ms.date: 10/21/2026 +ai-usage: ai-assisted no-loc: [ "UIScene", "SceneDelegate", "AppDelegate" ] --- @@ -101,13 +102,13 @@ If your app already customizes startup, don't overwrite it blindly. #if IOS || MACCATALYST events.AddiOS(ios => ios .SceneOnActivated((scene) => { /* ... */ }) - .SceneOpenUrl((scene, urlContexts) => { /* ... */ })); + .SceneOpenUrl((scene, urlContexts) => { /* ... */ return false; })); #endif }); ``` - **Cold-start deep links and activities**: URLs and user activities that launch the app arrive in the connection options of `SceneWillConnect`, not through the warm scene URL/activity callbacks. Handle these connection options in addition to the warm callbacks. Review notification-tap and authentication handling separately, preserving the relevant notification delegate and authentication-session completion callbacks. -- **Dynamic scene configuration**: Apple also supports providing a configuration by overriding `UIApplicationDelegate.GetConfiguration` (`UIApplicationDelegate.application(_:configurationForConnecting:options:)` in Objective-C and Swift) instead of declaring it in `Info.plist`. This is valid. The build-time check described below accepts an empty `UIApplicationSceneManifest` dictionary for this case, so add an empty one (or opt out of the check) if you configure scenes dynamically. +- **Dynamic scene configuration**: Apple also supports providing a configuration by overriding `UIApplicationDelegate.GetConfiguration` (`UIApplicationDelegate.application(_:configurationForConnecting:options:)` in Objective-C and Swift) instead of declaring scene configurations in `Info.plist`. In a standard .NET MAUI app, you still need at least an empty `UIApplicationSceneManifest` dictionary in `Info.plist`. Without the key, `MauiUIApplicationDelegate` hides that callback and creates a legacy window. The build-time check described below accepts an empty dictionary. ## Build-time check @@ -115,7 +116,7 @@ When building for iOS or Mac Catalyst against SDK 27 or later, the build checks The error message reads: "The app's Info.plist does not contain a UIApplicationSceneManifest dictionary. Apps built with the iOS or Mac Catalyst 27.0 SDK or later must use the UIKit scene lifecycle or they will crash at launch on iOS or macOS 27.0 or later. Add a scene manifest and scene delegate, and migrate custom lifecycle handlers as described at https://aka.ms/uiscene. To skip this build-time validation, set the MSBuild property ValidateSceneManifest to false; this does not disable the operating system's requirement." -The check is a heuristic on the manifest. It doesn't prove that your scene delegate or window is wired up correctly. To skip the check, opt out in the project file: +The check is a heuristic on the manifest. It doesn't prove that your scene delegate or window is wired up correctly. Opting out only disables this build-time validation; it isn't a substitute for the manifest in a standard .NET MAUI app, even if you configure scenes dynamically. To skip the check, opt out in the project file: ```xml @@ -134,7 +135,7 @@ If you're an AI agent resolving error MT7199 in a .NET MAUI app: 1. Add `SceneDelegate.cs` (derived from `MauiUISceneDelegate`, `[Register("SceneDelegate")]`, public) to each platform folder unless a suitable registered scene delegate already exists. Preserve existing custom delegate names and behavior, and match the manifest to the registered name. Keep `AppDelegate`. 1. Search the app for application-level lifecycle registrations and `AppDelegate` overrides (`OpenUrl`, `ContinueUserActivity`, `DidEnterBackground`, and so on) and migrate them as described in [Preserve existing customizations](#preserve-existing-customizations). 1. Don't change `SupportedOSPlatformVersion` merely to fix scene adoption, don't silently drop support for older operating systems, and don't downgrade .NET MAUI. Check the selected workload's independent deployment-target requirements. -1. Only set `ValidateSceneManifest` to `false` (or add an empty manifest dictionary) if scenes are configured dynamically, and tell the developer. +1. If scenes are configured dynamically, still make sure `UIApplicationSceneManifest` exists, at least as an empty dictionary. Only set `ValidateSceneManifest` to `false` if the developer explicitly wants to skip the validation, and tell them it only disables the build-time check. ## Let an AI agent do the migration From 4dcfaa0c3da950275b362c2e21f1a243a6aff693 Mon Sep 17 00:00:00 2001 From: Rolf Bjarne Kvinge Date: Mon, 26 Oct 2026 20:59:59 +0100 Subject: [PATCH 6/7] Address jfversluis review on scene lifecycle doc Move the package requirement ahead of the quick fix, cover window timing and App Actions, qualify the build check by workload availability, note the MT7198 vs MT7199 change, make the AI skill an optional note, and add a Mac Catalyst TOC entry. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> --- docs/TOC.yml | 2 ++ docs/ios/uikit-scene-lifecycle.md | 27 ++++++--------------------- 2 files changed, 8 insertions(+), 21 deletions(-) diff --git a/docs/TOC.yml b/docs/TOC.yml index e194630d02..676ed4b826 100644 --- a/docs/TOC.yml +++ b/docs/TOC.yml @@ -1033,6 +1033,8 @@ href: mac-catalyst/capabilities.md - name: Entitlements href: mac-catalyst/entitlements.md + - name: Migrate to the UIKit scene lifecycle + href: ios/uikit-scene-lifecycle.md - name: Information property list href: macios/info-plist.md - name: Linking diff --git a/docs/ios/uikit-scene-lifecycle.md b/docs/ios/uikit-scene-lifecycle.md index 436c542026..73d3760207 100644 --- a/docs/ios/uikit-scene-lifecycle.md +++ b/docs/ios/uikit-scene-lifecycle.md @@ -19,7 +19,7 @@ Apps created from .NET MAUI project templates before the fix don't contain the r Use a .NET for iOS and Mac Catalyst workload that supports your selected Xcode version. Independently of scene adoption, the .NET 27 SDKs require a minimum deployment target of iOS 15.0 and Mac Catalyst 17.0 (macOS 14). Keep a higher deployment target if your app already requires one. If you must support older operating systems, use a compatible older SDK rather than silently dropping those users. -Check the project's `global.json`, .NET MAUI package versions, and any configuration-specific `Info.plist` paths before editing. Apply the migration to every configuration that can produce a shipping app, including separate iOS and Mac Catalyst app projects. +Check the project's `global.json`, .NET MAUI package versions, and any configuration-specific `Info.plist` paths before editing. For a .NET 10 app, update to .NET MAUI 10.0.110 or a later compatible servicing release before enabling scenes; it includes the scene-based App Actions dispatch and relevant `WebAuthenticator` forwarding. Don't downgrade a newer compatible version. Apply the migration to every configuration that can produce a shipping app, including separate iOS and Mac Catalyst app projects. ## Quick fix for most apps @@ -73,10 +73,6 @@ Do the following for **both** `Platforms/iOS` and `Platforms/MacCatalyst` (skip When `UIApplicationSceneManifest` is present, `MauiUIApplicationDelegate` selects scene-based startup and returns the `__MAUI_DEFAULT_SCENE_CONFIGURATION__` scene configuration. `MauiUISceneDelegate` then creates the scene-backed window for your app. For details, see the [.NET MAUI pull request that updated the templates to use scenes](https://github.com/dotnet/maui/pull/38601). -## Update .NET MAUI - -Use .NET MAUI 10.0.110 or later. It includes scene forwarding for features such as app actions and `WebAuthenticator`. If you're already on a newer version, don't downgrade. See [Migrate .NET MAUI apps to the UIKit scene lifecycle](https://devblogs.microsoft.com/dotnet/migrate-dotnet-maui-apps-uikit-scene-lifecycle/) for details. - ## Preserve existing customizations If your app already customizes startup, don't overwrite it blindly. @@ -107,12 +103,13 @@ If your app already customizes startup, don't overwrite it blindly. }); ``` -- **Cold-start deep links and activities**: URLs and user activities that launch the app arrive in the connection options of `SceneWillConnect`, not through the warm scene URL/activity callbacks. Handle these connection options in addition to the warm callbacks. Review notification-tap and authentication handling separately, preserving the relevant notification delegate and authentication-session completion callbacks. +- **Cold-start deep links and activities**: URLs and user activities that launch the app arrive in the connection options of `SceneWillConnect`, not through the warm scene URL/activity callbacks. Handle these connection options in addition to the warm callbacks. `SceneWillConnect` runs before .NET MAUI creates the scene's window, so retain activation data and defer navigation until that window is created or activated. In the standard scene startup path, `AppDelegate.Window` remains `null`, including after `base.FinishedLaunching`; move startup code that needs a window to the owning scene's window when it's ready. Review notification-tap and authentication handling separately, preserving the relevant notification delegate and authentication-session completion callbacks. +- **App Actions**: if you override `AppDelegate.PerformActionForShortcutItem`, move that logic to a `ConfigureLifecycleEvents` registration. .NET MAUI 10.0.110 already forwards warm and cold scene shortcuts, so don't add duplicate `Platform.PerformActionForShortcutItem` forwarding. Each custom registration, including one that only logs, must call its completion callback exactly once. An app can launch successfully while shortcuts stop working, so test them. For more information, see [App actions](../platform-integration/appmodel/app-actions.md). - **Dynamic scene configuration**: Apple also supports providing a configuration by overriding `UIApplicationDelegate.GetConfiguration` (`UIApplicationDelegate.application(_:configurationForConnecting:options:)` in Objective-C and Swift) instead of declaring scene configurations in `Info.plist`. In a standard .NET MAUI app, you still need at least an empty `UIApplicationSceneManifest` dictionary in `Info.plist`. Without the key, `MauiUIApplicationDelegate` hides that callback and creates a legacy window. The build-time check described below accepts an empty dictionary. ## Build-time check -When building for iOS or Mac Catalyst against SDK 27 or later, the build checks that the app's final merged `Info.plist` contains a `UIApplicationSceneManifest` dictionary, and reports error **MT7199** if it's missing or isn't a dictionary. An empty dictionary is accepted, which supports dynamic scene configuration. App extensions, frameworks, and libraries are skipped. +In .NET for iOS and Mac Catalyst workloads that include scene-manifest validation, building against SDK 27 or later checks that the app's final merged `Info.plist` contains a `UIApplicationSceneManifest` dictionary, and reports error **MT7199** if it's missing or isn't a dictionary. Check your workload's release notes for availability; a successful build with an older workload doesn't prove scene adoption. An empty dictionary is accepted, which supports dynamic scene configuration. App extensions, frameworks, and libraries are skipped. Earlier drafts of this check used MT7198, which is now a different error (an extended-attributes signing error). The error message reads: "The app's Info.plist does not contain a UIApplicationSceneManifest dictionary. Apps built with the iOS or Mac Catalyst 27.0 SDK or later must use the UIKit scene lifecycle or they will crash at launch on iOS or macOS 27.0 or later. Add a scene manifest and scene delegate, and migrate custom lifecycle handlers as described at https://aka.ms/uiscene. To skip this build-time validation, set the MSBuild property ValidateSceneManifest to false; this does not disable the operating system's requirement." @@ -126,20 +123,8 @@ The check is a heuristic on the manifest. It doesn't prove that your scene deleg or on the command line: `-p:ValidateSceneManifest=false`. Opting out doesn't prevent the launch crash on iOS 27 / Mac Catalyst 27. -## Instructions for AI agents - -If you're an AI agent resolving error MT7199 in a .NET MAUI app: - -1. Find the `Platforms/iOS/Info.plist` and `Platforms/MacCatalyst/Info.plist` files for each platform the project targets (check `TargetFrameworks`). -1. If `UIApplicationSceneManifest` is missing, add it as shown in [Quick fix for most apps](#quick-fix-for-most-apps). If it exists, reconcile it with the registered delegate and window-creation code rather than replacing custom configurations or adding duplicate keys. -1. Add `SceneDelegate.cs` (derived from `MauiUISceneDelegate`, `[Register("SceneDelegate")]`, public) to each platform folder unless a suitable registered scene delegate already exists. Preserve existing custom delegate names and behavior, and match the manifest to the registered name. Keep `AppDelegate`. -1. Search the app for application-level lifecycle registrations and `AppDelegate` overrides (`OpenUrl`, `ContinueUserActivity`, `DidEnterBackground`, and so on) and migrate them as described in [Preserve existing customizations](#preserve-existing-customizations). -1. Don't change `SupportedOSPlatformVersion` merely to fix scene adoption, don't silently drop support for older operating systems, and don't downgrade .NET MAUI. Check the selected workload's independent deployment-target requirements. -1. If scenes are configured dynamically, still make sure `UIApplicationSceneManifest` exists, at least as an empty dictionary. Only set `ValidateSceneManifest` to `false` if the developer explicitly wants to skip the validation, and tell them it only disables the build-time check. - -## Let an AI agent do the migration - -The blog post [Get Your .NET MAUI App Ready for Xcode 27](https://devblogs.microsoft.com/dotnet/migrate-dotnet-maui-apps-uikit-scene-lifecycle/) describes an experimental `maui-xcode27-migration` agent skill, installed with the preview .NET MAUI CLI, that guides a coding agent through this migration. It's preview tooling that isn't covered by the Microsoft Support Policy, and you should review the resulting changes. The manual steps on this page work without it. +> [!NOTE] +> You can use the experimental [`maui-xcode27-migration` agent skill](https://github.com/dotnet/maui-labs/tree/main/plugins/dotnet-maui/skills/maui-xcode27-migration) to help inspect and migrate your project. Install or update the [.NET MAUI CLI](../developer-tools/cli/index.md) to version `0.1.0-preview.13.26512.5` or later, then run `maui ai add skill maui-xcode27-migration --env CopilotCli --yes` from your app's repository. Reload your agent session and ask it to use the skill. For other agent environments, see `maui ai add skill --help`. This preview tooling isn't covered by the Microsoft Support Policy. Installing the skill doesn't migrate your app; review the agent's changes and complete the same verification steps as for a manual migration. ## Test the migration From 117fdcc902dc95dfbdfe2ccce03e5355b38d10e7 Mon Sep 17 00:00:00 2001 From: Rolf Bjarne Kvinge Date: Tue, 27 Oct 2026 07:32:10 +0100 Subject: [PATCH 7/7] Fix MD034 bare URL in scene lifecycle doc Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> --- docs/ios/uikit-scene-lifecycle.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/ios/uikit-scene-lifecycle.md b/docs/ios/uikit-scene-lifecycle.md index 73d3760207..e05b686c2d 100644 --- a/docs/ios/uikit-scene-lifecycle.md +++ b/docs/ios/uikit-scene-lifecycle.md @@ -111,7 +111,7 @@ If your app already customizes startup, don't overwrite it blindly. In .NET for iOS and Mac Catalyst workloads that include scene-manifest validation, building against SDK 27 or later checks that the app's final merged `Info.plist` contains a `UIApplicationSceneManifest` dictionary, and reports error **MT7199** if it's missing or isn't a dictionary. Check your workload's release notes for availability; a successful build with an older workload doesn't prove scene adoption. An empty dictionary is accepted, which supports dynamic scene configuration. App extensions, frameworks, and libraries are skipped. Earlier drafts of this check used MT7198, which is now a different error (an extended-attributes signing error). -The error message reads: "The app's Info.plist does not contain a UIApplicationSceneManifest dictionary. Apps built with the iOS or Mac Catalyst 27.0 SDK or later must use the UIKit scene lifecycle or they will crash at launch on iOS or macOS 27.0 or later. Add a scene manifest and scene delegate, and migrate custom lifecycle handlers as described at https://aka.ms/uiscene. To skip this build-time validation, set the MSBuild property ValidateSceneManifest to false; this does not disable the operating system's requirement." +The error message reads: "The app's Info.plist does not contain a UIApplicationSceneManifest dictionary. Apps built with the iOS or Mac Catalyst 27.0 SDK or later must use the UIKit scene lifecycle or they will crash at launch on iOS or macOS 27.0 or later. Add a scene manifest and scene delegate, and migrate custom lifecycle handlers as described at . To skip this build-time validation, set the MSBuild property ValidateSceneManifest to false; this does not disable the operating system's requirement." The check is a heuristic on the manifest. It doesn't prove that your scene delegate or window is wired up correctly. Opting out only disables this build-time validation; it isn't a substitute for the manifest in a standard .NET MAUI app, even if you configure scenes dynamically. To skip the check, opt out in the project file: