From b4edaf007e5ac396bfb7ade792da592712df1b86 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Zieli=C5=84ski?= Date: Fri, 10 Oct 2025 16:00:52 +0200 Subject: [PATCH] Cleanup before refactor --- Bimix.UI.Mobile/Bimix.UI.Mobile.csproj | 32 +++++++++++++++++--- Bimix.UI.Mobile/MauiProgram.cs | 26 ++++++++++++---- Bimix.UI.Mobile/appsettings.Development.json | 5 +++ Bimix.UI.Mobile/appsettings.json | 5 +++ 4 files changed, 57 insertions(+), 11 deletions(-) create mode 100644 Bimix.UI.Mobile/appsettings.Development.json create mode 100644 Bimix.UI.Mobile/appsettings.json diff --git a/Bimix.UI.Mobile/Bimix.UI.Mobile.csproj b/Bimix.UI.Mobile/Bimix.UI.Mobile.csproj index c8fb4dc..e3df775 100644 --- a/Bimix.UI.Mobile/Bimix.UI.Mobile.csproj +++ b/Bimix.UI.Mobile/Bimix.UI.Mobile.csproj @@ -31,7 +31,7 @@ 1.0 1 - + 14.2 14.0 24.0 @@ -48,6 +48,24 @@ + + + + + + PreserveNewest + true + PreserveNewest + + + + PreserveNewest + true + PreserveNewest + appsettings.json + + + @@ -66,22 +84,26 @@ - + + + + + - - + + - + \ No newline at end of file diff --git a/Bimix.UI.Mobile/MauiProgram.cs b/Bimix.UI.Mobile/MauiProgram.cs index 97503c2..9e08df7 100644 --- a/Bimix.UI.Mobile/MauiProgram.cs +++ b/Bimix.UI.Mobile/MauiProgram.cs @@ -1,7 +1,14 @@ -using Bimix.UI.Mobile.Services; +using System.Reflection; +using Bimix.UI.Mobile.Services; using Bimix.UI.Shared.Extensions; using Bimix.UI.Shared.Interfaces; +using Bimix.UI.Shared.Services; +using Microsoft.Extensions.Configuration; +using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.Logging; +using Microsoft.Maui.Controls.Hosting; +using Microsoft.Maui.Devices; +using Microsoft.Maui.Hosting; using MudBlazor.Services; using ZXing.Net.Maui.Controls; @@ -17,6 +24,11 @@ public static class MauiProgram .UseBarcodeReader() .ConfigureFonts(fonts => { fonts.AddFont("OpenSans-Regular.ttf", "OpenSansRegular"); }); + builder.Configuration + .AddJsonFile("appsettings.json", optional: true, reloadOnChange: false) + .AddJsonFile($"appsettings.Development.json", optional: true, reloadOnChange: false) + .AddEnvironmentVariables(); + builder.Services.AddMauiBlazorWebView(); builder.Services.AddMudServices(); @@ -29,25 +41,27 @@ public static class MauiProgram builder.Services.AddSingleton(); } + builder.Services.AddScoped(); + var baseUrl = GetApiBaseUrl(); builder.Services.AddSharedServices(baseUrl); - + #if DEBUG builder.Services.AddBlazorWebViewDeveloperTools(); builder.Logging.AddDebug(); + builder.Logging.SetMinimumLevel(LogLevel.Debug); #endif return builder.Build(); } - + private static string GetApiBaseUrl() { #if IOS - // iOS symulator - użyj swojego IP - return "http://192.168.13.44:7142/"; // Zastąp swoim IP + // iOS symulator + return "http://192.168.29.140:7142/"; #else return "https://localhost:7142/"; #endif } - } \ No newline at end of file diff --git a/Bimix.UI.Mobile/appsettings.Development.json b/Bimix.UI.Mobile/appsettings.Development.json new file mode 100644 index 0000000..550f264 --- /dev/null +++ b/Bimix.UI.Mobile/appsettings.Development.json @@ -0,0 +1,5 @@ +{ + "GoogleAuth": { + "ClientId": "1037727384847-t1l2au6du34kdckamro81guklk17cjah.apps.googleusercontent.com" + } +} \ No newline at end of file diff --git a/Bimix.UI.Mobile/appsettings.json b/Bimix.UI.Mobile/appsettings.json new file mode 100644 index 0000000..550f264 --- /dev/null +++ b/Bimix.UI.Mobile/appsettings.json @@ -0,0 +1,5 @@ +{ + "GoogleAuth": { + "ClientId": "1037727384847-t1l2au6du34kdckamro81guklk17cjah.apps.googleusercontent.com" + } +} \ No newline at end of file