Skip to content

Commit d8a199a

Browse files
committed
Add support for barcode scanning. Fix for dotnet/android-libraries#764
1 parent 61a855e commit d8a199a

File tree

2 files changed

+14
-3
lines changed

2 files changed

+14
-3
lines changed

Diff for: SanteDB.Client.Mobile/MauiProgram.cs

+6-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
using Microsoft.Extensions.Logging;
1+
using BarcodeScanner.Mobile;
2+
using Microsoft.Extensions.Logging;
23
using SanteDB.Core.Applets.Services.Impl;
34
using SanteDB.Rest.HDSI;
45
using System.Diagnostics;
@@ -30,6 +31,10 @@ public static MauiApp CreateMauiApp()
3031
fonts.AddFont("OpenSans-Regular.ttf", "OpenSansRegular");
3132
fonts.AddFont("OpenSans-Semibold.ttf", "OpenSansSemibold");
3233
})
34+
.ConfigureMauiHandlers(handlers =>
35+
{
36+
handlers.AddBarcodeScannerHandler();
37+
})
3338
;
3439

3540
#if DEBUG

Diff for: SanteDB.Client.Mobile/SanteDB.Client.Mobile.csproj

+8-2
Original file line numberDiff line numberDiff line change
@@ -71,10 +71,16 @@
7171
</ItemGroup>
7272

7373
<ItemGroup>
74-
<PackageReference Include="Microsoft.Data.Sqlite.Core" Version="7.0.10" />
74+
<PackageReference Include="BarcodeScanner.Mobile.Maui" Version="7.0.0.1-pre" />
75+
<PackageReference Include="Microsoft.Data.Sqlite.Core" Version="7.0.11" />
7576
<PackageReference Include="Microsoft.Extensions.Logging.Debug" Version="7.0.0" />
7677
<PackageReference Include="Nito.AsyncEx.Context" Version="5.1.2" />
77-
<PackageReference Include="SQLitePCLRaw.bundle_e_sqlcipher" Version="2.1.5" />
78+
<PackageReference Include="SQLitePCLRaw.bundle_e_sqlcipher" Version="2.1.6" />
79+
</ItemGroup>
80+
81+
<ItemGroup Condition="'$(TargetFramework)' == 'net7.0-android'">
82+
<PackageReference Include="Xamarin.AndroidX.Activity.Ktx" Version="1.7.2.1" />
83+
<PackageReference Include="Xamarin.Google.MLKit.BarcodeScanning" Version="117.1.0.2" />
7884
</ItemGroup>
7985

8086
<ItemGroup>

0 commit comments

Comments
 (0)