using Microsoft.Extensions.Logging; using MudBlazor.Services; namespace Bimix.UI.Mobile; public static class MauiProgram { public static MauiApp CreateMauiApp() { var builder = MauiApp.CreateBuilder(); builder .UseMauiApp() .ConfigureFonts(fonts => { fonts.AddFont("OpenSans-Regular.ttf", "OpenSansRegular"); }); builder.Services.AddMauiBlazorWebView(); builder.Services.AddMudServices(); var baseUrl = GetApiBaseUrl(); builder.Services.AddScoped(sp => new HttpClient { BaseAddress = new Uri(baseUrl) }); #if DEBUG builder.Services.AddBlazorWebViewDeveloperTools(); builder.Logging.AddDebug(); #endif return builder.Build(); } private static string GetApiBaseUrl() { #if IOS // iOS symulator - użyj swojego IP return "http://192.168.1.100:5015/"; // Zastąp swoim IP #else return "https://localhost:7015/"; #endif } }