BarcodeScanning.Native.Maui 3.0.1

dotnet add package BarcodeScanning.Native.Maui --version 3.0.1
                    
NuGet\Install-Package BarcodeScanning.Native.Maui -Version 3.0.1
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="BarcodeScanning.Native.Maui" Version="3.0.1" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="BarcodeScanning.Native.Maui" Version="3.0.1" />
                    
Directory.Packages.props
<PackageReference Include="BarcodeScanning.Native.Maui" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add BarcodeScanning.Native.Maui --version 3.0.1
                    
#r "nuget: BarcodeScanning.Native.Maui, 3.0.1"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package BarcodeScanning.Native.Maui@3.0.1
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=BarcodeScanning.Native.Maui&version=3.0.1
                    
Install as a Cake Addin
#tool nuget:?package=BarcodeScanning.Native.Maui&version=3.0.1
                    
Install as a Cake Tool

BarcodeScanning.Native.Maui

Barcode scanning library based on native platform APIs for barcode detection:

  1. Google ML Kit
  2. Apple Vision framework
  3. zxing-cpp

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.

Key features

  1. Uses native APIs for maximal performance and barcode readability,
  2. Optimized for continuous scanning,
  3. Ability to scan multiple barcodes in one frame,
  4. Ability to pool multiple scans for better scanning consistency,
  5. Transformed barcode bounding box for on-screen positioning,
  6. From version 1.2.0 implemented 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,
  7. From version 1.4.1 ability to control camera zoom and camera selection on supported multi-camera setups on iOS and Android,
  8. From version 1.5.0 ability to save images from the camera feed.
  9. Code-behind and MVVM compatibility,
  10. Android only - Ability to invert source image to scan natively unsupported inverted barcodes, but at a performance cost.
  11. From version 3.0.1 Windows support

Usage

  1. Install Nuget package,
  2. Initialize the plugin in your MauiProgram.cs:
    public static MauiApp CreateMauiApp()
    {
        var builder = MauiApp.CreateBuilder();
        builder
            ...
            .UseBarcodeScanning();
            ...
    
        return builder.Build();
    }
    
  3. Add required permissions:
    Android
    Edit 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" />
    
    iOS/macOS
    Edit 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();
    
  4. In XAML, add correct namespace, for example:
    xmlns:scanner="clr-namespace:BarcodeScanning;assembly=BarcodeScanning.Native.Maui"
    
  5. Set the 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.
  6. Listen to 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)
            ...
    }
    
  7. As a best practice set the CameraEnabled property to false in OnDisappearing() method override in your ContentPage.
  8. From .NET MAUI 9 (version 2.0.0) manually calling DisconnectHandler() is no loger required, but optional. More info here: What's new in .NET MAUI for .NET 9
  9. From version 1.5.0 set the CaptureNextFrame 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.
  10. The image source is not limited to the built-in UI camera component. It can also be provided as a byte[], FileResult, string, or Stream using the methods available in the Methods class.

Supported barcode symbologies

Android

1D: Codabar, Code 39, Code 93, Code 128, EAN-8, EAN-13, ITF, UPC-A, UPC-E; 2D: Aztec, Data Matrix, PDF417, QR Code

iOS/macOS

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

Windows

1D: Codabar, Code 39, Code 93, Code 128, EAN-8, EAN-13, ITF, UPC-A, UPC-E, DataBar; 2D: Aztec, Data Matrix, PDF417, QR Code, MicroQR

Bindable properties

A list of bindable properties with descriptions can be found in CameraView.cs source file.

Product Compatible and additional computed target framework versions.
.NET net10.0 is compatible.  net10.0-android was computed.  net10.0-android36.0 is compatible.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-ios26.0 is compatible.  net10.0-maccatalyst was computed.  net10.0-maccatalyst26.0 is compatible.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed.  net10.0-windows10.0.19041 is compatible. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages (7)

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

Cyber.FrameworkNet8_FutaHaSon

Phiên bản FTHS khách hàng phát triển trên nền tảng .Net Maui

ItEnterprise.Maui.Scanning

ItEnterprise scanning library for 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.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
3.0.1 1,466 1/21/2026
3.0.0-beta4 1,315 12/11/2025
3.0.0-beta3 1,240 12/2/2025
3.0.0-beta2 1,335 11/22/2025
3.0.0-beta 813 11/14/2025
2.2.1 150,788 5/29/2025
2.1.9 2,889 5/20/2025
2.1.8 40,522 3/28/2025
2.1.7 14,501 2/27/2025
2.1.6 30,315 1/28/2025
2.1.3 6,691 12/11/2024
2.1.2 3,358 12/4/2024
2.1.1 1,795 11/25/2024
2.0.1 1,371 11/19/2024
2.0.0 1,706 11/18/2024
1.8.0 12,199 5/27/2025
1.7.9 1,058 5/20/2025
1.7.8 20,097 3/28/2025
1.7.7 5,325 2/27/2025
1.7.6 5,878 1/28/2025
1.7.3 3,304 12/11/2024
1.7.2 535 12/4/2024
1.7.1 4,146 11/25/2024
1.6.0 14,896 11/11/2024
1.5.9 11,450 10/19/2024
1.5.8 73,639 10/1/2024
1.5.7 71,027 7/11/2024
1.5.6 11,577 6/19/2024
1.5.5 2,489 6/12/2024
1.5.3 5,034 5/24/2024
1.5.2 2,358 5/17/2024
1.5.0 22,730 4/20/2024
1.4.3 1,466 4/11/2024
1.4.2 1,975 4/4/2024
1.4.1 1,830 3/22/2024
1.4.0 1,203 3/17/2024
1.3.1 7,223 3/13/2024
1.3.0 250 3/13/2024
1.2.5 887 3/8/2024
1.2.4 6,784 1/24/2024
1.2.3 2,096 1/9/2024
1.2.2 1,014 12/27/2023
1.2.1 434 12/20/2023
1.2.0 495 12/17/2023
1.1.1 509 12/6/2023
1.1.0 439 12/4/2023
1.0.3 379 11/27/2023
1.0.2 555 11/24/2023
1.0.1 400 11/16/2023
0.9.3 19,949 4/19/2023
0.9.1 496 3/31/2023