using CommunityToolkit.Maui; using CommunityToolkit.Mvvm.Messaging; using IntegryApiClient.MAUI; using Microsoft.AspNetCore.Components.Authorization; using Microsoft.Extensions.Logging; using MudBlazor.Services; using MudExtensions.Services; using salesbook.Maui.Core.RestClient.IntegryApi; using salesbook.Maui.Core.Services; using salesbook.Maui.Core.System; using salesbook.Maui.Core.System.Network; using salesbook.Maui.Core.System.Notification; using salesbook.Maui.Core.System.Notification.Push; using salesbook.Shared; using salesbook.Shared.Core.Dto; using salesbook.Shared.Core.Dto.PageState; using salesbook.Shared.Core.Helpers; using salesbook.Shared.Core.Interface; using salesbook.Shared.Core.Interface.IntegryApi; using salesbook.Shared.Core.Interface.System; using salesbook.Shared.Core.Interface.System.Network; using salesbook.Shared.Core.Interface.System.Notification; using salesbook.Shared.Core.Messages.Activity.Copy; using salesbook.Shared.Core.Messages.Activity.New; using salesbook.Shared.Core.Messages.Back; using salesbook.Shared.Core.Messages.Contact; using salesbook.Shared.Core.Messages.Notification.Loaded; using salesbook.Shared.Core.Messages.Notification.NewPush; using salesbook.Shared.Core.Services; using Shiny; namespace salesbook.Maui { public static class MauiProgram { private const string AppToken = "f0484398-1f8b-42f5-ab79-5282c164e1d8"; public static MauiAppBuilder CreateMauiAppBuilder() { InteractiveRenderSettings.ConfigureBlazorHybridRenderModes(); var builder = MauiApp.CreateBuilder(); builder .UseMauiApp() .UseIntegry(appToken: AppToken, useLoginAzienda: true) .UseMauiCommunityToolkit() .UseShiny() .UseSentry(options => { options.Dsn = "https://453b6b38f94fd67e40e0d5306d6caff8@o4508499810254848.ingest.de.sentry.io/4509605099667536"; #if DEBUG options.Debug = true; #endif options.TracesSampleRate = 1.0; }) .ConfigureFonts(fonts => { fonts.AddFont("OpenSans-Regular.ttf", "OpenSansRegular"); }); builder.Services.AddMauiBlazorWebView(); builder.Services.AddMudServices(); builder.Services.AddMudExtensions(); builder.Services.AddAutoMapper(typeof(MappingProfile)); builder.Services.AddAuthorizationCore(); builder.Services.AddScoped(); builder.Services.AddScoped(provider => provider.GetRequiredService()); builder.Services.AddScoped(); builder.Services.AddScoped(); builder.Services.AddScoped(); builder.Services.AddScoped(); //SessionData builder.Services.AddSingleton(); builder.Services.AddSingleton(); builder.Services.AddSingleton(); builder.Services.AddSingleton(); builder.Services.AddSingleton(); //Message builder.Services.AddSingleton(); builder.Services.AddSingleton(); builder.Services.AddSingleton(); builder.Services.AddSingleton(); builder.Services.AddSingleton(); builder.Services.AddSingleton(); builder.Services.AddSingleton(); //Notification builder.Services.AddNotifications(); builder.Services.AddPush(); builder.Services.AddSingleton(); builder.Services.AddSingleton(); builder.Services.AddSingleton(); builder.Services.AddSingleton(); builder.Services.AddSingleton(); #if DEBUG builder.Services.AddBlazorWebViewDeveloperTools(); builder.Logging.AddDebug(); #endif builder.Services.AddSingleton(); builder.Services.AddSingleton(); builder.Services.AddSingleton(); builder.Services.AddSingleton(); builder.Services.AddSingleton(); _ = typeof(System.Runtime.InteropServices.SafeHandle); _ = typeof(System.IO.FileStream); return builder; } } }