![]() |
VOOZH | about |
dotnet add package ZXing.Net.Maui.Comet --version 0.5.2
NuGet\Install-Package ZXing.Net.Maui.Comet -Version 0.5.2
<PackageReference Include="ZXing.Net.Maui.Comet" Version="0.5.2" />
<PackageVersion Include="ZXing.Net.Maui.Comet" Version="0.5.2" />Directory.Packages.props
<PackageReference Include="ZXing.Net.Maui.Comet" />Project file
paket add ZXing.Net.Maui.Comet --version 0.5.2
#r "nuget: ZXing.Net.Maui.Comet, 0.5.2"
#:package ZXing.Net.Maui.Comet@0.5.2
#addin nuget:?package=ZXing.Net.Maui.Comet&version=0.5.2Install as a Cake Addin
#tool nuget:?package=ZXing.Net.Maui.Comet&version=0.5.2Install as a Cake Tool
The successor to ZXing.Net.Mobile: barcode scanning and generation for .NET MAUI applications
<img src="https://user-images.githubusercontent.com/271950/129272315-b3f5a468-c585-49f2-bbab-68a884618b94.png" width="300" />
Install ZXing.Net.Maui.Controls NuGet package on your .NET MAUI application
Make sure to initialize the plugin first in your MauiProgram.cs, see below
// Add the using to the top
using ZXing.Net.Maui.Controls;
// ... other code
public static MauiApp Create()
{
var builder = MauiApp.CreateBuilder();
builder
.UseMauiApp<App>()
.UseBarcodeReader(); // Make sure to add this line
return builder.Build();
}
Now we just need to add the right permissions to our app metadata. Find below how to do that for each platform.
For Android go to your 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" />
For iOS go to your info.plist file (under the Platforms\iOS folder) and add the following permissions inside of the dict node:
<key>NSCameraUsageDescription</key>
<string>This app uses barcode scanning to...</string>
Make sure that you enter a clear and valid reason for your app to access the camera. This description will be shown to the user.
Windows is not supported at this time for barcode scanning. You can however use the barcode generation. No extra permissions are required for that.
For more information on permissions, see the Microsoft Docs.
If you're using the controls from XAML, make sure to add the right XML namespace in the root of your file, e.g: xmlns:zxing="clr-namespace:ZXing.Net.Maui.Controls;assembly=ZXing.Net.MAUI.Controls"
<zxing:CameraBarcodeReaderView
x:Name="cameraBarcodeReaderView"
BarcodesDetected="BarcodesDetected" />
Configure Reader options
cameraBarcodeReaderView.Options = new BarcodeReaderOptions
{
Formats = BarcodeFormats.OneDimensional,
AutoRotate = true,
Multiple = true
};
Toggle Torch
cameraBarcodeReaderView.IsTorchOn = !cameraBarcodeReaderView.IsTorchOn;
Flip between Rear/Front cameras
cameraBarcodeReaderView.CameraLocation
= cameraBarcodeReaderView.CameraLocation == CameraLocation.Rear ? CameraLocation.Front : CameraLocation.Rear;
Handle detected barcode(s)
protected void BarcodesDetected(object sender, BarcodeDetectionEventArgs e)
{
foreach (var barcode in e.Results)
Console.WriteLine($"Barcodes: {barcode.Format} -> {barcode.Value}");
}
<zxing:BarcodeGeneratorView
HeightRequest="100"
WidthRequest="100"
ForegroundColor="DarkBlue"
Value="https://dotnet.microsoft.com"
Format="QrCode"
Margin="3" />
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net9.0 net9.0 is compatible. net9.0-android net9.0-android was computed. net9.0-android35.0 net9.0-android35.0 is compatible. net9.0-browser net9.0-browser was computed. net9.0-ios net9.0-ios was computed. net9.0-ios18.0 net9.0-ios18.0 is compatible. net9.0-maccatalyst net9.0-maccatalyst was computed. net9.0-maccatalyst18.0 net9.0-maccatalyst18.0 is compatible. net9.0-macos net9.0-macos was computed. net9.0-tvos net9.0-tvos was computed. net9.0-windows net9.0-windows was computed. net9.0-windows10.0.19041 net9.0-windows10.0.19041 is compatible. net10.0 net10.0 was computed. net10.0-android net10.0-android was computed. net10.0-browser net10.0-browser was computed. net10.0-ios net10.0-ios was computed. net10.0-maccatalyst net10.0-maccatalyst was computed. net10.0-macos net10.0-macos was computed. net10.0-tvos net10.0-tvos was computed. net10.0-windows net10.0-windows was computed. |
This package is not used by any NuGet packages.
Showing the top 1 popular GitHub repositories that depend on ZXing.Net.Maui.Comet:
| Repository | Stars |
|---|---|
|
simpleidserver/SimpleIdServer
OpenID, OAuth 2.0, SCIM2.0, UMA2.0, FAPI, CIBA & OPENBANKING Framework for ASP.NET Core
|
| Version | Downloads | Last Updated |
|---|---|---|
| 0.5.2 | 350 | 9/12/2025 |
| 0.5.1 | 254 | 9/11/2025 |
| 0.5.0 | 233 | 9/5/2025 |
| 0.5.0-preview.2 | 230 | 8/28/2025 |
| 0.5.0-preview.1 | 236 | 8/27/2025 |
| 0.4.0 | 1,285 | 10/24/2023 |
| 0.3.0-preview.1 | 1,616 | 11/10/2022 |
| 0.2.0-preview.2 | 376 | 10/21/2022 |