NativeScript

NativeScript Barcode Scanner SDK

Add barcode and QR scanning to NativeScript apps for Android and iOS. The barkoder-nativescript plugin puts a native scanner view in your layout and sends results to your TypeScript code. It also reads passports and ID cards (MRZ), VINs, DPM codes and South African licenses.

nativescript barcode scanner

A NativeScript barcode plugin with a native scanner view

barkoder-nativescript is the official barKoder plugin for NativeScript, published on npm. It ships the native barKoder libraries for Android and iOS, plus TypeScript sources and type definitions. You add a BarkoderView to your page, and each scan result arrives in a callback in your view model.

Install the NativeScript barcode scanner

Add the plugin from npm. The current release is 1.7.2, published in September 2026.

Shell
          npm i barkoder-nativescript
        

You can also download the package from the barKoder Developer Portal and add it from a local path. Without a license key the plugin still scans, but results carry an (Unlicensed) prefix, so get a trial key before you test.

Start your free trial

See a complete app on NativeScript 9

The official full demo app is written in TypeScript. It uses NativeScript 9 (@nativescript/core ~9.0.0) with barkoder-nativescript 1.7.2, and covers the scanning modes on this page.

  • The plugin package declares NativeScript platform runtime 6 or later for Android and iOS.
  • Gallery scanning in the demo uses @nativescript/imagepicker.
  • Every method is listed in the NativeScript API reference.
Open the NativeScript demo app on GitHub

Scan your first barcode in a NativeScript app

These snippets are copied from the NativeScript installation guide in the barKoder docs. The guide uses an XML layout and a TypeScript view model.

  1. Import Import BarkoderConstants from the barkoder-nativescript package.
  2. Place Add a Barkoder:BarkoderView to your page and size it.
  3. License Get the view in your view model and call setLicenseKey with your key.
  4. Scan Call startScanning and read textualData and barcodeTypeName in scanningFinished.
Import the constants
        import { BarkoderConstants } from 'barkoder-nativescript/barkoder-nativescript.common';
      
main-view-model.ts
        export class HelloWorldModel extends Observable implements BarkoderConstants.BarkoderResultCallback {
        private barkoderView : any
        constructor(args) {
        super()
        this.barkoderView = args.object.page.getViewById('barkoderView');
        this.barkoderView.setLicenseKey("License_Key")
        }
        scanningFinished(results: any[], thumbnails: any[], resultImage: any): void {
        console.log(`${results[0].textualData}`)
        console.log(`${results[0].barcodeTypeName}`)
        }
      
main-page.xml
        <Page >
        ...
        <Barkoder:BarkoderView id="barkoderView"  class="scanner-container" width="100%" height="70%"/>
        ...
      
Start scanning
        this.barkoderView.startScanning(this)
      
iOS Info.plist
        <key>NSCameraUsageDescription</key>
        <string>Camera permission</string>
      

On Android, the plugin declares the camera permission for you. On iOS, add the camera usage description above. Continue with the NativeScript general example to enable barcode types, and check the NativeScript API reference for every setting.

Choosing a NativeScript QR scanner or barcode plugin

Most NativeScript QR scanner tutorials still point to free plugins. Here is how the packages compare, based on their npm releases and READMEs in October 2026.

Package Latest release on npm License What it covers
barkoder-nativescript 1.7.2, September 2026 Commercial, with a free 30-day trial 1D and 2D barcodes, MRZ, VIN with OCR fallback, DPM, South African license parsing, Batch MultiScan, AR Mode and gallery scan on Android and iOS
nativescript-barcodescanner 4.1.2, July 2021 MIT Full-screen and embedded scanning. Its README lists some formats as Android-only or iOS-only, and the embedded view as iOS-only.
@nstudio/nativescript-barcodescanner 5.0.1, November 2021 Apache-2.0 The same API and README as nativescript-barcodescanner, published for NativeScript 7 and later
@nativescript/mlkit-barcode-scanning 3.0.4, October 2025 Apache-2.0 Google ML Kit barcode detection through an MLKitView, with 13 listed formats including QR, Data Matrix, PDF417 and Aztec

A free plugin can be enough for clean QR codes in good light. Test a commercial SDK when users scan damaged, blurred or engraved codes, many codes at once, passports and ID cards, or VINs. Compare successful reads on your own samples and devices, and check when each package was last released.

Continuous scanning, Batch MultiScan, MRZ, VIN and DPM in NativeScript

Each mode is a few calls on the same BarkoderView. The snippets come from the NativeScript examples in the barKoder docs.

Continuous scanning

Keep the camera session open

Scan item after item without restarting the scanner. The duplicate threshold controls repeats: -1 reads each barcode once, 0 reads it again with no delay, and a value above 0 waits that many seconds.

TypeScript
            this.barkoderView.setCloseSessionOnResultEnabled(false)
            this.barkoderView.setThresholdBetweenDuplicatesScans(0) // it can take values -1, or n > 0
          
Enable continuous scanning in NativeScript →

Batch MultiScan

Many barcodes in one camera view

Read several barcodes without stopping after each one, with result caching and a maximum results count. The docs recommend normal decoding speed and resolution for this mode.

TypeScript
            private setMultiScan() : void {
            this.barkoderView.setRegionOfInterestVisible(true)
            this.barkoderView.setCloseSessionOnResultEnabled(false)
            this.barkoderView.setRegionOfInterestVisible(true)
            this.barkoderView.setMulticodeCachingEnabled(true)
            this.barkoderView.setMulticodeCachingDuration(3000)
            this.barkoderView.setMaximumResultsCount(200)
            this.barkoderView.setDecodingSpeed(BarkoderConstants.DecodingSpeed.Normal)
            this.barkoderView.setBarkoderResolution(BarkoderConstants.BarkoderResolution.NORMAL)
            }
          
Enable Batch MultiScan in NativeScript →

MRZ scanning

Passports, ID cards and visas

Enable the IDDocument type to read the machine-readable zone of travel and identity documents. Results include data such as name, nationality, passport number and expiration date, and the docs show how to get the document, picture and signature images.

TypeScript
            private setBarcodeTypeEnabled(): void {
            this.barkoderView.setBarcodeTypeEnabled([
            BarkoderConstants.DecoderType.IDDocument
            ]);
            }
          
Enable MRZ mode in NativeScript →

VIN scanning with OCR fallback

Code 39, Code 128, Data Matrix and QR

The VIN setup enables the four barcode types a VIN can use, VIN restrictions, slow decoding and high resolution. With an OCR-enabled license, the SDK falls back to the printed VIN text when the barcode can't be decoded. OCR VIN is available from version 1.6.7, and on Android it needs the ML Kit text recognition dependency shown in the docs.

Enable OCR VIN support in NativeScript →

DPM mode

Codes etched or printed on parts

Direct Part Marking puts a Data Matrix code straight onto metal or plastic. The DPM setup enables Data Matrix with DPM mode, slow decoding, FHD resolution and a small region of interest.

TypeScript
            private setDpmMode() : void {
            this.barkoderView.setBarcodeTypeEnabled(
            [BarkoderConstants.DecoderType.Datamatrix]
            )
            this.barkoderView.setRegionOfInterestVisible(true)
            this.barkoderView.setDatamatrixDpmModeEnabled(true)
            this.barkoderView.setRegionOfInterestVisible(true)
            this.barkoderView.setDecodingSpeed(BarkoderConstants.DecodingSpeed.Slow)
            this.barkoderView.setBarkoderResolution(BarkoderConstants.BarkoderResolution.FHD)
            this.barkoderView.setRegionOfInterest(40, 40, 20, 10);
            }
          
See the NativeScript DPM mode example →

South African driving licenses

PDF417 with on-device parsing

Enable PDF417 and the SADL formatting type to parse South African driving licenses. Two custom options add parsing for South African ID cards and vehicle license discs.

TypeScript
            // Enable PDF417 symbology and South African Driving License parser
            barkoderView.setBarcodeTypeEnabled([
            BarkoderConstants.DecoderType.PDF417
            ]);
            barkoderView.setFormattingType(BarkoderConstants.FormattingType.SADL)
            // Parsers for data in South African IDs and South African Vehicle License Discs
            barkoderView.setCustomOption("SADL_decode_ID", 1)
            barkoderView.setCustomOption("SADL_decode_vehicle_disk", 1)
          
Enable the South African driving license parser in NativeScript →

Damaged and difficult barcodes

The same decoding engine as the native SDKs

  • MatrixSight® reads QR and Data Matrix codes with missing finder, timing or alignment patterns.
  • Segment Decoding® reads 1D barcodes on curved or irregular surfaces such as bottles and test tubes.
  • DeBlur reads EAN and UPC codes with motion, lens or focus blur.
  • PDF417-LineSight® reads PDF417 barcodes with missing start or stop patterns and data columns.

AR Mode and gallery scan

Overlays on the preview, and images from the photo library

  • AR Mode draws boxes and barcode status on the camera preview, with interactive and non-interactive modes and your own colors.
  • Gallery scan decodes BMP, PNG and JPG images that users pick from the photo library, through scanImage.

Where the NativeScript plugin runs

barkoder-nativescript wraps the native Android and iOS SDKs, so your NativeScript app gets the same decoding as a native app.

Targets and requirements

  • NativeScript apps for Android and iOS. The package declares NativeScript platform runtime 6 or later, and the official demo app runs on NativeScript 9.
  • Android 5.0 (API 21) or later.
  • iOS 15.0 or later for version 1.7.2. Building for iOS needs macOS with Xcode.
  • Camera: at least 1280×720. Devices with an 8 MP autofocus camera are recommended.
  • Scanning runs on the device. The SDK goes online only for the license check, and each device must reach the licensing server at least once every 30 days.

Barcode types

1D barcodes

Codabar, Code 11, Code 25, Code 32, Code 39, Code 93, Code 128, COOP 2 of 5, Datalogic 2 of 5, GS1 DataBar, GS1 Composite, EAN-8, EAN-13, IATA 2 of 5, Interleaved 2 of 5, ITF-14, Matrix 2 of 5, MSI Plessey, Postal Barcodes, Telepen, UPC-A, UPC-E and UPC-E1.

2D barcodes

Aztec Code, Aztec Compact, Data Matrix, DotCode, MaxiCode, PDF417, Micro PDF417, QR Code and Micro QR Code.

See all supported barcode types →

Building with another stack? See the cross-platform barcode SDK overview for Flutter, React Native, .NET MAUI, Capacitor and Cordova. For scanning in a browser, use the Web Barcode Scanner SDK (WASM).

One scanning engine for NativeScript, native and web

The engine behind barkoder-nativescript also ships as native, web, desktop and cross-platform SDKs, so the same decoding runs in every app you build.

  • 7 native & desktop SDKs
  • 6 cross-platform integrations
  • One consistent scanning core

Teams that ship barKoder on Android and iOS

Cross-platform rollouts and scanner replacements from barKoder customers.

Lotos Tourist by Datalab Montenegro

Montenegro · Tourism guest registration

Less than a dayto fully implement the SDK

Chose barKoder for MRZ scanning in the Lotos Tourist app after testing both open-source and commercial alternatives, for consistent results on Android and iOS, including older devices.

Read the Lotos Tourist story →

inexto

Switzerland · Track and trace

Migrated from Cognexfor DPM scanning on industrial mobile computers

Uses barKoder in two factory and logistics track-and-trace projects on devices such as the Zebra TC series, and lists wide platform support among its reasons.

What truly made us choose barKoder was the simplicity of integration and high performance in DPM barcode scanningNicolas Schaefer, Head of R&D, inexto
Read the inexto story →

WayMark Infotech

South Africa · Voter registration

Up to 80%faster registration processing

Reads PDF417 and MRZ data on an Android app and a React web portal, with offline scanning in remote areas and 500 licenses deployed.

barKoder's PDF417 scanning accuracy and cross-platform reliability exceeded our expectations.Paul Sentle, WayMark Infotech
Read the WayMark Infotech story →

Try barKoder on your phone or in your browser

Install the free barKoder demo app, or open the web demo, and scan your own barcodes before you integrate the SDK.

iPhone and iPad

barKoder demo app for iOS

Scan with your camera, or point it at the QR code to open the App Store.

Download on the App Store
QR code linking to the barKoder demo app on the App Store

Android phones and tablets

barKoder demo app for Android

Scan with your camera, or point it at the QR code to open Google Play.

Get it on Google Play
QR code linking to the barKoder demo app on Google Play

Any modern browser

barKoder web demo

Runs the Web SDK in your browser, on desktop or mobile, with nothing to install.

Open the web demo
QR code linking to the barKoder web demo

Test with known samples. Print or display the testing sheet and scan each 1D and 2D barcode with the demo app. The data sheet summarizes the SDK for your team.

NativeScript barcode scanner questions

What is the best barcode scanner plugin for NativeScript?

It depends on what you scan. For occasional QR codes in good light, a free plugin can be enough. If users scan damaged, blurred or engraved barcodes, many barcodes at once, passports and ID cards, or VINs, test barKoder on your own samples and devices. Compare successful reads, how often a code has to be repositioned, and when each plugin was last released.

Is nativescript-barcodescanner still maintained?

Its last npm release, 4.1.2, came out in July 2021. The @nstudio/nativescript-barcodescanner fork was last released as 5.0.1 in November 2021. barkoder-nativescript 1.7.2 was released in September 2026, and the official demo app runs on NativeScript 9.

Is barkoder-nativescript a TypeScript barcode scanner SDK?

Yes. The package ships its TypeScript sources and an index.d.ts with type definitions, and the docs examples and the full demo app are written in TypeScript with XML layouts. The docs don't include Angular or Vue examples. If you use NativeScript with Angular or Vue, ask barKoder support before you start.

Which NativeScript, Android and iOS versions are supported?

The package declares NativeScript platform runtime 6 or later, and the official demo app uses NativeScript 9. The SDK supports Android 5.0 (API 21) and later. Version 1.7.2 needs iOS 15.0 or later. Check the barkoder-nativescript package on npm for the current release.

Can I scan QR codes from images in the photo library?

Yes. QR Code and Micro QR Code are among the supported 2D types, and gallery scan decodes BMP, PNG and JPG images with scanImage. The NativeScript gallery scan example uses @nativescript/imagepicker to let users pick the image.

Can a NativeScript app read passports, ID cards and driver's licenses?

Yes. Enable the IDDocument type to read the MRZ on passports, ID cards and visas. For South African driving licenses, ID cards and vehicle license discs, use the PDF417 parser options in the South African driving license example. barKoder reads barcodes and MRZ. It is not a general document scanner, and its OCR is built for VIN recognition.

Does scanning need an internet connection?

Only for the license check. The SDK checks the license key with the barKoder licensing server when the app initializes it. All scanning runs on the device, and each device must reach the licensing server at least once every 30 days to keep returning licensed results.

How does the free trial work?

Generate a key on the trial page or in the barKoder Developer Portal. A trial license lasts 30 days and covers up to 25 devices, with unlimited scans. No credit card is required.

Add barcode scanning to your NativeScript app

Install barkoder-nativescript and test it on your own barcodes and devices with a free 30-day trial, or talk to an SDK expert about your project.