Scan ean code on iOS app
This commit is contained in:
@@ -1,6 +1,9 @@
|
||||
using Bimix.UI.Shared.Extensions;
|
||||
using Bimix.UI.Mobile.Services;
|
||||
using Bimix.UI.Shared.Extensions;
|
||||
using Bimix.UI.Shared.Interfaces;
|
||||
using Microsoft.Extensions.Logging;
|
||||
using MudBlazor.Services;
|
||||
using ZXing.Net.Maui.Controls;
|
||||
|
||||
namespace Bimix.UI.Mobile;
|
||||
|
||||
@@ -11,12 +14,21 @@ public static class MauiProgram
|
||||
var builder = MauiApp.CreateBuilder();
|
||||
builder
|
||||
.UseMauiApp<App>()
|
||||
.UseBarcodeReader()
|
||||
.ConfigureFonts(fonts => { fonts.AddFont("OpenSans-Regular.ttf", "OpenSansRegular"); });
|
||||
|
||||
builder.Services.AddMauiBlazorWebView();
|
||||
|
||||
builder.Services.AddMudServices();
|
||||
|
||||
if (DeviceInfo.Platform == DevicePlatform.iOS)
|
||||
{
|
||||
builder.Services.AddSingleton<IScannerService, ScannerService>();
|
||||
}
|
||||
else
|
||||
{
|
||||
builder.Services.AddSingleton<IScannerService, NoOpScannerService>();
|
||||
}
|
||||
|
||||
var baseUrl = GetApiBaseUrl();
|
||||
builder.Services.AddSharedServices(baseUrl);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user