Barcode Scanning

Available on: iOS Android React Native Flutter Cordova .NET MAUI

Overview

The Genius Scan SDK includes a dedicated barcode scanning flow that detects barcodes and QR codes in real-time via the device’s camera. This is designed for continuous, live scanning scenarios like warehouse management, inventory tracking, and ticket validation.

The integration is extremely fast (you should be done in less than one hour), and works across platforms.

Key Features

  • Real-time Detection - Instant barcode recognition without capturing photos
  • Batch Mode - Scan multiple unique codes in a single session
  • Wide Format Support - Detects 1D barcodes, 2D codes, QR codes, and more
  • High Performance - Optimized for speed with minimal battery impact

Demo

The simple demo projects from our demo repository demonstrate how to configure the barcode scanning.

Prerequisites

Before implementing barcode scanning, you need to install and configure the SDK.

Basic Implementation

Once you’ve installed and configured the SDK, implement barcode scanning in just a few lines:

// Start the flow
let readableCodeFlow = GSKReadableCodeFlow(configuration: configuration)

do {
    let result = try await readableCodeFlow.resultByStarting(fromViewController: self)

    // Process detected codes
    for code in result.readableCodes {
        print("Detected \(code.type): \(code.value)")
    }
} catch {
    // Handle cancellation or errors
    print("Scanning error: \(error)")
}
// Register for result
val readableCodeLauncher = registerForActivityResult(
    ReadableCodeFlow.createContract()
) { result ->
    when (result) {
        is ReadableCodeFlowResult.Success -> {
            // Process detected codes
            result.codes.forEach { code ->
                Log.d("Scanner", "Detected ${code.type}: ${code.value}")
            }
        }
        is ReadableCodeFlowResult.Cancelled -> {
            // User cancelled
        }
        is ReadableCodeFlowResult.Error -> {
            // Handle error
            Log.e("Scanner", "Error: ${result.message}")
        }
    }
}

// Launch the scanner
readableCodeLauncher.launch(configuration)
cordova.plugins.GeniusScan.scanReadableCodesWithConfiguration(
    configuration,
    function(result) {
        // Success - process codes
        result.readableCodes.forEach(code => {
            console.log(`Detected ${code.type}: ${code.value}`);
        });
    },
    function(error) {
        // Handle error
        console.error('Scanning failed:', error);
    }
);
import GeniusScan from '@thegrizzlylabs/react-native-genius-scan';

try {
    const result = await GeniusScan.scanReadableCodesWithConfiguration(configuration);

    // Process detected codes
    result.readableCodes.forEach(code => {
        console.log(`Detected ${code.type}: ${code.value}`);
    });
} catch (error) {
    console.error('Scanning error:', error);
}
import 'package:flutter_genius_scan/flutter_genius_scan.dart';

try {
    final result = await FlutterGeniusScan.scanReadableCodesWithConfiguration(configuration);

    for (var code in result['readableCodes']) {
        print('Detected ${code['type']}: ${code['value']}');
    }
} catch (e) {
    print('Scanning failed: $e');
}

For .NET MAUI (and Xamarin), reuse the partial ScanFlowService bridge from the document scan flow. The shared project calls into platform-specific implementations that invoke the native readable code flow:

var scanFlowService = new ScanFlowService();
scanFlowService.SetLicenseKey("YOUR_LICENSE_KEY");

var configuration = new Dictionary<string, object>
{
    ["IsBatchModeEnabled"] = true,
    ["SupportedCodeTypes"] = new[] { "qr", "code128" }
};

var resultJson = await scanFlowService.StartScanningReadableCodes(configuration);
// Parse resultJson (JSON string) to access detected codes.

See the demo for the platform implementations:

Barcode Scanning Configuration

Feature Description Property Type Values
Batch mode Scan multiple codes in session isBatchModeEnabled Bool (default: false)
Supported code types Barcode formats to detect supportedCodeTypes [GSKReadableCodeType] .qr, .ean13, .ean8, .upcA, .upcE, .code128, .code93, .code39, .interleaved2of5, .codabar, .dataMatrix, .pdf417, .aztec
Highlight color Color for detected code overlay highlightColor UIColor Any UIColor value
Menu color UI menu color menuColor UIColor Any UIColor value
Feature Description Property Type Values
Batch mode Scan multiple codes in session isBatchModeEnabled Boolean (default: false)
Supported code types Barcode formats to detect supportedCodeTypes Set QR, EAN13, EAN8, UPC_A, UPC_E, CODE128, CODE93, CODE39, INTERLEAVED_2_OF_5, CODABAR, DATA_MATRIX, PDF417, AZTEC
Highlight color Color for detected code overlay highlightColor Int (Color) Any color integer
Menu color UI menu color menuColor Int (Color) Any color integer
Feature Description Property Type Values
Batch mode Scan multiple codes in session isBatchModeEnabled boolean (default: false)
Supported code types Barcode formats to detect supportedCodeTypes array qr, ean13, ean8, upcA, upcE, code128, code93, code39, interleaved2of5, codabar, dataMatrix, pdf417, aztec
Highlight color Color for detected code overlay highlightColor string Hex color (#00FF00)
Menu color UI menu color menuColor string Hex color (#0000FF)
Feature Description Property Type Values
Batch mode Scan multiple codes in session isBatchModeEnabled boolean (default: false)
Supported code types Barcode formats to detect supportedCodeTypes array qr, ean13, ean8, upcA, upcE, code128, code93, code39, interleaved2of5, codabar, dataMatrix, pdf417, aztec
Highlight color Color for detected code overlay highlightColor string Hex color (#00FF00)
Menu color UI menu color menuColor string Hex color (#0000FF)
Feature Description Property Type Values
Batch mode Scan multiple codes in session isBatchModeEnabled bool (default: false)
Supported code types Barcode formats to detect supportedCodeTypes List qr, ean13, ean8, upcA, upcE, code128, code93, code39, interleaved2of5, codabar, dataMatrix, pdf417, aztec
Highlight color Color for detected code overlay highlightColor String Hex color (#00FF00)
Menu color UI menu color menuColor String Hex color (#0000FF)
Feature Description Property Type Values
Batch mode Scan multiple codes in session IsBatchModeEnabled bool (default: false)
Supported code types Barcode formats to detect SupportedCodeTypes List qr, ean13, ean8, upcA, upcE, code128, code93, code39, interleaved2of5, codabar, dataMatrix, pdf417, aztec
Highlight color Color for detected code overlay HighlightColor Color Color object
Menu color UI menu color MenuColor Color Color object

Scanning Modes

Standard Mode

  • Scans a single code
  • Returns immediately after detection
  • Perfect for quick lookups

Batch Mode

  • Scans multiple unique codes
  • Filters out duplicates automatically
  • User taps “Done” when finished
  • Ideal for inventory management

Enable batch mode by setting:

configuration.isBatchModeEnabled = true

Supported Code Types

The SDK supports a wide range of barcode formats:

1D Barcodes:

  • EAN-13, EAN-8
  • UPC-A, UPC-E
  • Code 128, Code 93, Code 39
  • Interleaved 2 of 5
  • Codabar

2D Codes:

  • QR Code
  • Data Matrix
  • PDF417
  • Aztec

What’s Next?

Products

Industries

Case Studies

Integration

Company

© 2025 The Grizzly Labs. All rights reserved.