![]() |
VOOZH | about |
dotnet add package BarcodeScanning.Native.Maui --version 3.0.4
NuGet\Install-Package BarcodeScanning.Native.Maui -Version 3.0.4
<PackageReference Include="BarcodeScanning.Native.Maui" Version="3.0.4" />
<PackageVersion Include="BarcodeScanning.Native.Maui" Version="3.0.4" />Directory.Packages.props
<PackageReference Include="BarcodeScanning.Native.Maui" />Project file
paket add BarcodeScanning.Native.Maui --version 3.0.4
#r "nuget: BarcodeScanning.Native.Maui, 3.0.4"
#:package BarcodeScanning.Native.Maui@3.0.4
#addin nuget:?package=BarcodeScanning.Native.Maui&version=3.0.4Install as a Cake Addin
#tool nuget:?package=BarcodeScanning.Native.Maui&version=3.0.4Install as a Cake Tool
Barcode scanning library based on native platform APIs for barcode detection:
This library was inspired by existing MAUI barcode scanning libraries: BarcodeScanner.Mobile & Zxing.Net.MAUI, but comes with many code improvements and uses native ML APIs on both Android and iOS/macOS.
ViewfinderMode - detect only barcodes present in camera preview on screen and AimMode - detect only the barcode that is overlapped with the red dot centred in camera preview,MauiProgram.cs:
public static MauiApp CreateMauiApp()
{
var builder = MauiApp.CreateBuilder();
builder
...
.UseBarcodeScanning();
...
return builder.Build();
}
AndroidManifest.xml file (under the Platforms\Android folder) and add the following permissions inside of the manifest node:
<uses-permission android:name="android.permission.CAMERA" />
<uses-permission android:name="android.permission.VIBRATE" />
info.plist file (under the Platforms\iOS or Platforms\MacCatalyst folder) and add the following permissions inside of the dict node:
<key>NSCameraUsageDescription</key>
<string>Enable camera for barcode scanning.</string>
And ask for permission from user in your code:
await Methods.AskForRequiredPermissionAsync();
xmlns:scanner="clr-namespace:BarcodeScanning;assembly=BarcodeScanning.Native.Maui"
CameraEnabled property to true in XAML, code behind or ViewModel to start the camera. As a best practice set it in OnAppearing() method override in your ContentPage.OnDetectionFinished event in Code-behind:
<scanner:CameraView ...
OnDetectionFinished="CameraView_OnDetectionFinished"
.../>
private void CameraView_OnDetectionFinished(object sender, OnDetectionFinishedEventArg e)
{
if (e.BarcodeResults.Count > 0)
...
}
or bind OnDetectionFinishedCommand property to a Command in your ViewModel:
<scanner:CameraView ...
OnDetectionFinishedCommand="{Binding DetectionFinishedCommand}"
.../>
public ICommand DetectionFinishedCommand { get; set; }
...
DetectionFinishedCommand = new Command<IReadOnlySet<BarcodeResult>>(IReadOnlySet<BarcodeResult> result) =>
{
if (result.Count > 0)
...
}
CameraEnabled property to false in OnDisappearing() method override in your ContentPage.DisconnectHandler() is no loger required, but optional. More info here: What's new in .NET MAUI for .NET 9CaptureNextFrame property to true to capture next frame from the camera feed as a PlatformImage. Listen to OnImageCaptured event or bind to OnImageCapturedCommand property to get the caputured image. Image is captured from the original camera feed and can be different from the on-screen preview. After the image is captured CaptureNextFrame property is automaticly set to false to prevent memory leaks. Example can be found in ScanTab.xaml.cs.byte[], FileResult, string, or Stream using the methods available in the Methods class.1D: Codabar, Code 39, Code 93, Code 128, EAN-8, EAN-13, ITF, UPC-A, UPC-E; 2D: Aztec, Data Matrix, PDF417, QR Code
1D: Codabar, Code 39, Code 93, Code 128, EAN-8, EAN-13, GS1 DataBar, ITF, UPC-A, UPC-E; 2D: Aztec, Data Matrix, MicroPDF417, MicroQR, PDF417, QR Code
1D: Codabar, Code 39, PZN, Code 93, Code 128, EAN-8, EAN-5, EAN-2, EAN-13, EAN/UPC, ITF, ITF-14, UPC-A, UPC-E, ISBN, DataBar, DataBar Omni, DataBar Stacked, DataBar Stacked Omni, DataBar Limited, DataBar Expanded, DataBar Expanded Stacked, DX Film Edge; 2D: Aztec, Aztec Code, Aztec Rune, Data Matrix, PDF417, Compact PDF417, Micro PDF417, QR Code, QR Code Model 1, QR Code Model 2, MicroQR, rMQR, MaxiCode
A list of bindable properties with descriptions can be found in CameraView.cs source file.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net10.0 net10.0 is compatible. net10.0-android net10.0-android was computed. net10.0-android36.0 net10.0-android36.0 is compatible. net10.0-browser net10.0-browser was computed. net10.0-ios net10.0-ios was computed. net10.0-ios26.0 net10.0-ios26.0 is compatible. net10.0-maccatalyst net10.0-maccatalyst was computed. net10.0-maccatalyst26.0 net10.0-maccatalyst26.0 is compatible. net10.0-macos net10.0-macos was computed. net10.0-tvos net10.0-tvos was computed. net10.0-windows net10.0-windows was computed. net10.0-windows10.0.19041 net10.0-windows10.0.19041 is compatible. |
Showing the top 5 NuGet packages that depend on BarcodeScanning.Native.Maui:
| Package | Downloads |
|---|---|
|
VertiGIS.Mobile
Create VertiGIS Mobile apps for Android, iOS, and UWP. Extend your apps with custom components, operations and services. |
|
|
Cyber.FrameworkNet8
Phiên bản CyberPlus phát triển trên nền tảng .Net Maui |
|
|
ItEnterprise.Maui.Scanning
ItEnterprise scanning library for MAUI |
|
|
Cyber.FrameworkNet8_FutaHaSon
Phiên bản FTHS khách hàng phát triển trên nền tảng .Net Maui |
|
|
OpenMAUIAndroid
Uma lib de leitura de código de barras que agrupa os mais diversos SDKs e EMDKs de fabricantes de coletores de dados, e gerencia tudo de forma automática. |
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 3.0.4 | 5,801 | 5/29/2026 |
| 3.0.3 | 61,406 | 2/13/2026 |
| 3.0.2 | 7,752 | 2/5/2026 |
| 3.0.1 | 9,260 | 1/21/2026 |
| 3.0.0-beta4 | 2,969 | 12/11/2025 |
| 3.0.0-beta3 | 1,998 | 12/2/2025 |
| 3.0.0-beta2 | 1,836 | 11/22/2025 |
| 3.0.0-beta | 1,010 | 11/14/2025 |
| 2.2.1 | 269,511 | 5/29/2025 |
| 2.1.9 | 3,997 | 5/20/2025 |
| 2.1.8 | 46,005 | 3/28/2025 |
| 2.1.7 | 16,050 | 2/27/2025 |
| 2.1.6 | 34,684 | 1/28/2025 |
| 1.8.0 | 19,609 | 5/27/2025 |
| 1.7.9 | 1,144 | 5/20/2025 |
| 1.7.8 | 25,183 | 3/28/2025 |
| 1.7.7 | 5,693 | 2/27/2025 |
| 1.7.6 | 7,154 | 1/28/2025 |