{"record":{"id":"bc6638c264529eda","repo":"dotnet/maui","slug":"pushasync-is-not-supported-globally-on-ios-please","errorCode":null,"errorMessage":"PushAsync is not supported globally on iOS, please use a NavigationPage.","messagePattern":"PushAsync is not supported globally on iOS, please use a NavigationPage\\.","errorType":"exception","errorClass":"InvalidOperationException","httpStatus":null,"severity":"error","filePath":"src/Compatibility/Core/src/iOS/Platform.cs","lineNumber":162,"sourceCode":"\n\t\tTask INavigation.PopToRootAsync()\n\t\t{\n\t\t\treturn ((INavigation)this).PopToRootAsync(true);\n\t\t}\n\n\t\tTask INavigation.PopToRootAsync(bool animated)\n\t\t{\n\t\t\tthrow new InvalidOperationException(\"PopToRootAsync is not supported globally on iOS, please use a NavigationPage.\");\n\t\t}\n\n\t\tTask INavigation.PushAsync(Page root)\n\t\t{\n\t\t\treturn ((INavigation)this).PushAsync(root, true);\n\t\t}\n\n\t\tTask INavigation.PushAsync(Page root, bool animated)\n\t\t{\n\t\t\tthrow new InvalidOperationException(\"PushAsync is not supported globally on iOS, please use a NavigationPage.\");\n\t\t}\n\n\t\tTask INavigation.PushModalAsync(Page modal)\n\t\t{\n\t\t\treturn ((INavigation)this).PushModalAsync(modal, true);\n\t\t}\n\n\t\tTask INavigation.PushModalAsync(Page modal, bool animated)\n\t\t{\n\t\t\tEndEditing();\n\n\t\t\tvar elementConfiguration = modal as IElementConfiguration<Page>;\n\n\t\t\tvar presentationStyle = elementConfiguration?.On<PlatformConfiguration.iOS>()?.ModalPresentationStyle().ToPlatformModalPresentationStyle();\n\n\t\t\tbool shouldFire = true;\n\n\t\t\tif (Forms.IsiOS13OrNewer)","sourceCodeStart":144,"sourceCodeEnd":180,"githubUrl":"https://github.com/dotnet/maui/blob/f377ff1c5ee04d334d8a925f50c83a6b7afddf03/src/Compatibility/Core/src/iOS/Platform.cs#L144-L180","documentation":"Platform.cs throws InvalidOperationException for INavigation.PushAsync on iOS. The global Platform only supports modal presentation; pushing a page onto a navigation stack requires a NavigationPage.","triggerScenarios":"Calling MainPage.Navigation.PushAsync(page) when MainPage is not a NavigationPage.","commonSituations":"Cross-platform code that works on Android but is invoked on iOS with a non-NavigationPage root; misusing Navigation.PushAsync from a ContentPage that is not inside a NavigationPage.","solutions":["Wrap the root in a NavigationPage and call PushAsync on that.","Use PushModalAsync for modal presentation.","Refactor shared navigation to be NavigationPage-rooted on iOS."],"exampleFix":"// before\nawait Application.Current.MainPage.Navigation.PushAsync(new DetailPage());\n// after\nApplication.Current.MainPage = new NavigationPage(new RootPage());\nawait Application.Current.MainPage.Navigation.PushAsync(new DetailPage());","handlingStrategy":"validation","validationCode":"if (!(Application.Current.MainPage is NavigationPage))\n    Application.Current.MainPage = new NavigationPage(Application.Current.MainPage);\nawait Application.Current.MainPage.Navigation.PushAsync(page);","typeGuard":"static bool SupportsStackNavigation(Page p) => p is NavigationPage;","tryCatchPattern":null,"preventionTips":["Wrap root in NavigationPage for PushAsync on iOS.","Use PushModalAsync for modal presentation.","Keep shared navigation NavigationPage-rooted."],"tags":["maui","xamarin-forms","ios","navigation","navigationpage","invalidoperation"],"backgroundTag":null,"analyzedSha":"f377ff1c5ee04d334d8a925f50c83a6b7afddf03","analyzedAt":"2026-08-13T14:26:18.069Z","schemaVersion":2},"datasetVersion":"2026-08-13T19:17:28.613Z"}