From 1dcd3a3daa36a33ac496424b43686fd89fb2c98e Mon Sep 17 00:00:00 2001 From: Dinis Vieira Date: Sat, 7 Oct 2023 16:56:08 +0100 Subject: [PATCH] PM-3349 Changed UseMauiApp init so that Android Handlers still get added --- src/App/MauiProgram.cs | 3 ++- src/Core/MauiProgram.cs | 11 +++++------ src/iOS.Core/Utilities/iOSCoreHelpers.cs | 2 +- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/App/MauiProgram.cs b/src/App/MauiProgram.cs index e66ce346c..106bb7aa0 100644 --- a/src/App/MauiProgram.cs +++ b/src/App/MauiProgram.cs @@ -32,7 +32,8 @@ namespace Bit.App #else iOS.Core.Utilities.iOSCoreHelpers.ConfigureMAUIHandlers(handlers); #endif - } + }, + initUseMauiApp: true ).Build(); } } diff --git a/src/Core/MauiProgram.cs b/src/Core/MauiProgram.cs index 161af22b8..d86e20525 100644 --- a/src/Core/MauiProgram.cs +++ b/src/Core/MauiProgram.cs @@ -10,14 +10,13 @@ namespace Bit.Core; public static class MauiProgram { - public static MauiAppBuilder ConfigureMauiAppBuilder(Action customEffectsBuilder, Action customHandlers) - { - return ConfigureBaseMauiAppBuilder(customEffectsBuilder, customHandlers) - .UseMauiApp(); - } - public static MauiAppBuilder ConfigureBaseMauiAppBuilder(Action customEffectsBuilder, Action customHandlers) + public static MauiAppBuilder ConfigureMauiAppBuilder(Action customEffectsBuilder, Action customHandlers, bool initUseMauiApp = false) { var builder = MauiApp.CreateBuilder(); + if(initUseMauiApp) + { + builder.UseMauiApp(); + } builder .UseMauiCommunityToolkit() .UseMauiCompatibility() diff --git a/src/iOS.Core/Utilities/iOSCoreHelpers.cs b/src/iOS.Core/Utilities/iOSCoreHelpers.cs index 0596b4c30..8567a9452 100644 --- a/src/iOS.Core/Utilities/iOSCoreHelpers.cs +++ b/src/iOS.Core/Utilities/iOSCoreHelpers.cs @@ -27,7 +27,7 @@ namespace Bit.iOS.Core.Utilities public static void SetupMaui() { - var builder = Bit.Core.MauiProgram.ConfigureBaseMauiAppBuilder(ConfigureMAUIEffects, ConfigureMAUIHandlers) + var builder = Bit.Core.MauiProgram.ConfigureMauiAppBuilder(ConfigureMAUIEffects, ConfigureMAUIHandlers) .UseMauiEmbedding(); // Register the Window builder.Services.Add(new ServiceDescriptor(typeof(UIWindow), UIApplication.SharedApplication.KeyWindow));