On this page

Stuck? Open a support ticket and the barKoder team will help. Open a ticket

NativeScript API reference

Every method, setting, enum and result of the barKoder NativeScript SDK, grouped by what you do with it.

This page will explain all available methods and configuration settings of the barKoder Barcode Scanner SDK for NativeScript.

Scanning & session #

startScanning #

Starts scanning for barcodes.

Parameters:

BarkoderResultCallback: The callback that will handle barcode scanning events.

Syntax:

TypeScript
startScanning(BarkoderResultCallback : BarkoderConstants.BarkoderResultCallback) : void

stopScanning #

Stops the barcode scanning process.

Syntax:

TypeScript
stopScanning() : void

pauseScanning #

Pauses the barcode scanning process.

Syntax:

TypeScript
pauseScanning() : void

setLicenseKey #

Set your actual license key provided by the plugin.

Parameters:

licenseKey: license key.

Syntax:

TypeScript
setLicenseKey(licenseKey : string) : void

setDecodingSpeed #

Sets the decoding speed for barcode scanning.

Parameters:

decodingSpeed: The decoding speed to be set.

Syntax:

TypeScript
setDecodingSpeed(decodingSpeed : BarkoderConstants.DecodingSpeed) : void

setThreadsLimit #

Set the threads limit.

Parameters:

threadsLimit: The threads limit.

Syntax:

TypeScript
setThreadsLimit(threadsLimit : number) : void

configureBarkoder #

Set the config for a Barkoder.

Syntax:

TypeScript
configureBarkoder(config: BarkoderConstants.BarkoderConfig): void

BarkoderConfig #

The settings configureBarkoder applies, in BarkoderConstants (from barkoder-nativescript/barkoder-nativescript.common); every field is optional, but give it a decoder (the package reads it). Barcode types go in decoder (DekoderConfig), one entry per type, and decoder-wide settings in its general (GeneralSettings). A decoder sets all the types: the ones you leave out are turned off, so list every type you scan.

TypeScript
class BarkoderConfig {
    locationLineColor?: string;
    locationLineWidth?: number;
    roiLineColor?: string;
    roiLineWidth?: number;
    roiOverlayBackgroundColor?: string;
    closeSessionOnResultEnabled?: boolean;
    imageResultEnabled?: boolean;
    locationInImageResultEnabled?: boolean;
    locationInPreviewEnabled?: boolean;
    pinchToZoomEnabled?: boolean;
    regionOfInterestVisible?: boolean;
    barkoderResolution?: number;
    beepOnSuccessEnabled?: boolean;
    vibrateOnSuccessEnabled?: boolean;
    decoder?: DekoderConfig;
    constructor(config: Partial<BarkoderConfig>);
}

The entries of DekoderConfig, and GeneralSettings:

TypeScript
class DekoderConfig {
    aztec?: BarcodeConfig;
    aztecCompact?: BarcodeConfig;
    qr?: BarcodeConfig;
    qrMicro?: BarcodeConfig;
    code128?: BarcodeConfigWithLength;
    code93?: BarcodeConfigWithLength;
    code39?: Code39BarcodeConfig;
    codabar?: BarcodeConfigWithLength;
    code11?: Code11BarcodeConfig;
    msi?: MSIBarcodeConfig;
    upcA?: BarcodeConfig;
    upcE?: BarcodeConfig;
    upcE1?: BarcodeConfig;
    ean13?: BarcodeConfig;
    ean8?: BarcodeConfig;
    pdf417?: BarcodeConfig;
    pdf417Micro?: BarcodeConfig;
    datamatrix?: DatamatrixBarcodeConfig;
    code25?: BarcodeConfig;
    interleaved25?: BarcodeConfig;
    itf14?: BarcodeConfig;
    iata25?: BarcodeConfig;
    matrix25?: BarcodeConfig;
    datalogic25?: BarcodeConfig;
    coop25?: BarcodeConfig;
    code32?: BarcodeConfig;
    telepen?: BarcodeConfig;
    dotcode?: BarcodeConfig;
    idDocument?: BarcodeConfig;
    databar14?: BarcodeConfig;
    databarExpanded?: BarcodeConfig;
    databarLimited?: BarcodeConfig;
    postalIMB?: BarcodeConfig;
    postnet?: BarcodeConfig;
    planet?: BarcodeConfig;
    australianPost?: BarcodeConfig;
    royalMail?: BarcodeConfig;
    kix?: BarcodeConfig;
    japanasePost?: BarcodeConfig;
    maxicode?: BarcodeConfig;
    ocrText?: BarcodeConfig;
    general?: GeneralSettings;
    constructor(config: Partial<DekoderConfig>);
}

class GeneralSettings {
    threadsLimit?: number;
    decodingSpeed?: DecodingSpeed;
    roiX?: number;
    roiY?: number;
    roiWidth?: number;
    roiHeight?: number;
    formattingType?: FormattingType;
    encodingCharacterSet?: string;
    upcEanDeblur?: number;
    enableMisshaped1D?: number;
    constructor(config: Partial<GeneralSettings>);
    setROI(x: number, y: number, width: number, height: number): void;
}

The classes of the entries (setLengthRange sets the length range a type reads):

TypeScript
class BarcodeConfig {
    enabled?: boolean;
    constructor(config: Partial<BarcodeConfig>);
}

class BarcodeConfigWithLength {
    enabled?: boolean;
    constructor(config: Partial<BarcodeConfigWithLength>);
    setLengthRange(minLength: number, maxLength: number): void;
}

class MSIBarcodeConfig {
    enabled?: boolean;
    checksum?: MsiChecksumType;
    constructor(config: Partial<MSIBarcodeConfig>);
    setLengthRange(minLength: number, maxLength: number): void;
}

class Code39BarcodeConfig {
    enabled?: boolean;
    checksum?: Code39ChecksumType;
    constructor(config: Partial<Code39BarcodeConfig>);
    setLengthRange(minLength: number, maxLength: number): void;
}

class Code11BarcodeConfig {
    enabled?: boolean;
    checksum?: Code11ChecksumType;
    constructor(config: Partial<Code11BarcodeConfig>);
    setLengthRange(minLength: number, maxLength: number): void;
}

class DatamatrixBarcodeConfig {
    enabled?: boolean;
    dpmMode?: number;
    constructor(config: Partial<DatamatrixBarcodeConfig>);
    setLengthRange(minLength: number, maxLength: number): void;
}

class QRBarcodeConfig {
    enabled?: boolean;
    dpmMode?: number;
    constructor(config: Partial<QRBarcodeConfig>);
    setLengthRange(minLength: number, maxLength: number): void;
}

class QRMicroBarcodeConfig {
    enabled?: boolean;
    dpmMode?: number;
    constructor(config: Partial<QRMicroBarcodeConfig>);
    setLengthRange(minLength: number, maxLength: number): void;
}

Example: UPC-A, EAN-13 and Code 128 (4 to 30 characters); every other type is off, QR too.

TypeScript
import { BarkoderConstants } from 'barkoder-nativescript/barkoder-nativescript.common';

// in the view model, with the BarkoderView of the page (this.barkoderView)
const code128 = new BarkoderConstants.BarcodeConfigWithLength({ enabled: true });
code128.setLengthRange(4, 30);
this.barkoderView.configureBarkoder(new BarkoderConstants.BarkoderConfig({
  beepOnSuccessEnabled: false,
  decoder: new BarkoderConstants.DekoderConfig({
    upcA: new BarkoderConstants.BarcodeConfig({ enabled: true }),
    ean13: new BarkoderConstants.BarcodeConfig({ enabled: true }),
    code128: code128,
    general: new BarkoderConstants.GeneralSettings({ decodingSpeed: BarkoderConstants.DecodingSpeed.Normal }),
  }),
}));

getVersion #

Gets barKoder SDK version.

Syntax:

TypeScript
getVersion() : any

getDecodingSpeed #

Get the decoding speed for barcode scanning.

Syntax:

TypeScript
getDecodingSpeed() : any

getMsiCheckSumType #

Get the checksum type for MSI barcodes.

Syntax:

TypeScript
getMsiCheckSumType() : any

getCode11CheckSumType #

Get the checksum type for Code 11 barcodes.

Syntax:

TypeScript
getCode11CheckSumType() : any

getCode39CheckSumType #

Get the checksum type for Code 39 barcodes.

Syntax:

TypeScript
getCode39CheckSumType() : any

getThreadsLimit #

Get the threads limit.

Syntax:

TypeScript
getThreadsLimit() : any

freezeScanning #

Freezes the current AR scanning session by capturing a still image from the camera feed. Use only when AR mode is enabled to temporarily freeze the view while keeping overlays visible.

Syntax:

TypeScript
freezeScanning()

unfreezeScanning #

Unfreezes the AR scanning session by removing the still image and reactivating the camera and overlays. Use only when AR mode is enabled to restore the live AR view and continue scanning.

Syntax:

TypeScript
unfreezeScanning()

setUPCEexpandToUPCA #

TypeScript
setUPCEexpandToUPCA(enabled): void

Sets whether the UPC-E barcodes should be expanded to UPC-A format.

Parameters:

NameType
enabledboolean

setUPCE1expandToUPCA #

TypeScript
setUPCE1expandToUPCA(enabled): void

Sets whether the UPC-E1 barcodes should be expanded to UPC-A format.

Parameters:

NameType
enabledboolean

setPowerSavingMode #

TypeScript
setPowerSavingMode(powerSavingMode): void

Power saving mode level. Higher values reduce CPU/battery usage by limiting frame processing.

Default value is 0.
0 - Disabled (full performance)
1 - Light saving
2 - Medium saving
3 - High saving
4 - Maximum saving

Parameters:

NameType
powerSavingModenumber

setVideoStabilization #

TypeScript
setVideoStabilization(value): void

Enable or disable video stabilization for smoother video capture.

Parameters:

NameType
valueboolean

selectVisibleBarcodes #

Selects all barcodes that are currently visible in AR mode.

Syntax:

TypeScript
selectVisibleBarcodes()

setDynamicExposure #

Sets the camera's exposure dynamically based on the provided intensity, cycling through predefined compensation values.

Parameters:

  • value: The integer value for the exposure intensity.

Syntax:

TypeScript
setDynamicExposure(value: number): void

getPowerSavingMode #

TypeScript
getPowerSavingMode()

Retrieves the power saving mode level.

Models, #

DecodingSpeed #

TypeScript
export enum DecodingSpeed {
  Fast = 0,
  Normal = 1,
  Slow = 2,
  Rigorous = 3
}

Camera #

startCamera #

Starts the camera for barcode scanning.

Syntax:

TypeScript
startCamera() : void

setFlashEnabled #

Sets the flash (torch) on or off for barcode scanning.

Parameters:

enabled: True to enable the flash, false to disable it.

Syntax:

TypeScript
setFlashEnabled(enabled : boolean) : void

configureFlashButton #

Configures the flash (torch) button shown during scanning; auto-hides if the device torch is unavailable.

Parameters:

position: [x, y]; tintColor, backgroundColor: a hex color string or a Color, or null; the custom icons are base64 images, used when useCustomIcon is true.

Syntax:

TypeScript
configureFlashButton(visible: boolean, position: number[], iconSize: number, tintColor: string | Color | null, backgroundColor: string | Color | null, cornerRadius: number, padding: number, useCustomIcon: boolean, flashOnIconBase64: string, flashOffIconBase64: string): void

setZoomFactor #

Sets the zoom factor for the camera used in barcode scanning.

Parameters:

zoomFactor: The zoom factor to set.

Syntax:

TypeScript
setZoomFactor(zoomFactor : number) : void

configureZoomButton #

Configures the zoom button shown during scanning.

Parameters:

position: [x, y]; tintColor, backgroundColor: a hex color string or a Color, or null; the custom icons are base64 images, used when useCustomIcon is true; zoomedInFactor, zoomedOutFactor: the zoom of the two states.

Syntax:

TypeScript
configureZoomButton(visible: boolean, position: number[], iconSize: number, tintColor: string | Color | null, backgroundColor: string | Color | null, cornerRadius: number, padding: number, useCustomIcon: boolean, zoomInIconBase64: string, zoomOutIconBase64: string, zoomedInFactor: number, zoomedOutFactor: number): void

setPinchToZoomEnabled #

Enables or disables pinch-to-zoom functionality for the camera used in barcode scanning.

Parameters:

enabled: True to enable pinch-to-zoom, false to disable it.

Syntax:

TypeScript
setPinchToZoomEnabled(enabled : boolean) : void

setLocationInPreviewEnabled #

Enables or disables displaying the barcode location in the camera preview.

Parameters:

enabled: True to display the location, false to hide it.

Syntax:

TypeScript
setLocationInPreviewEnabled(enabled : boolean) : void

setBarkoderResolution #

Sets the resolution for barcode scanning.

Parameters:

barkoderResolution: The barkoder resolution to be set.

Syntax:

TypeScript
setBarkoderResolution(barkoderResolution : BarkoderConstants.BarkoderResolution) : void

isFlashAvailable #

Get a value indicating whether the flash is available.

Syntax:

TypeScript
isFlashAvailable(callback : BarkoderConstants.FlashAvailableCallback): void

getMaxZoomFactor #

Get the maximum zoom factor

Syntax:

TypeScript
getMaxZoomFactor(callback : BarkoderConstants.MaxZoomAvailableCallback): void

getCurrentZoomFactor #

Retrieves the current zoom factor for the device's camera.

Syntax:

TypeScript
getCurrentZoomFactor(): any

isLocationInPreviewEnabled #

Get a value indicating whether the location is displayed in the camera preview.

Syntax:

TypeScript
isLocationInPreviewEnabled() : any

isPinchToZoomEnabled #

Get a value indicating whether pinch-to-zoom functionality is enabled.

Syntax:

TypeScript
isPinchToZoomEnabled() : any

getBarkoderResolution #

Get the resolution for barcode scanning.

Syntax:

TypeScript
getBarkoderResolution() : any

setPreviewMirrored #

Controls whether the front camera preview is horizontally mirrored.

Parameters:

mirrored: true to mirror it (the default when left out).

Syntax:

TypeScript
setPreviewMirrored(mirrored: boolean): void

isPreviewMirrored #

Retrieves whether the front camera preview is horizontally mirrored.

Syntax:

TypeScript
isPreviewMirrored(): boolean

setCamera #

TypeScript
setCamera(value): void

Parameters:

NameType
valuenumber

BarkoderCameraPosition #

The camera setCamera uses.

TypeScript
export enum BarkoderCameraPosition {
  Back = 0,
  Front = 1
}

setCentricFocusAndExposure #

Selects all barcodes that are currently visible in AR mode.

Parameters:

value: A boolean indicating whether the center of the viewfinder should be used.

Syntax:

TypeScript
setCentricFocusAndExposure(enabled: boolean): void

BarkoderResolution #

TypeScript
export enum BarkoderResolution {
  HD = 'HD',
  FHD = 'Full HD',
  UHD = 'Ultra HD'
}

Barcode types #

setFormattingType #

Sets the formatting type for barcode scanning.

Parameters:

formattingType: The formatting type to be set.

Syntax:

TypeScript
setFormattingType(formattingType : BarkoderConstants.FormattingType) : void

getSadlImageFromExtra #

The picture of a South African driving license from a result's extra (SADL formatting), as on the SADL parser page; null when there is none.

Parameters:

extra: the result's extra.

Syntax:

TypeScript
getSadlImageFromExtra(extra: any): ImageSource | null

setMsiChecksumType #

Sets the checksum type for MSI barcodes.

Parameters:

msiChecksumType: The MSI checksum type to be set.

Syntax:

TypeScript
setMsiChecksumType(msiCheckSumType : BarkoderConstants.MsiCheckSumType) : void

setCode11ChecksumType #

Sets the checksum type for Code 11 barcodes.

Parameters:

code11ChecksumType: The Code 11 checksum type to be set.

Syntax:

TypeScript
setCode11ChecksumType(code11CheckSumType : BarkoderConstants.Code11CheckSumType) : void

setCode39ChecksumType #

Sets the checksum type for Code 39 barcodes.

Parameters:

code39ChecksumType: The Code 39 checksum type to be set.

Syntax:

TypeScript
setCode39ChecksumType(code39ChecksumType : BarkoderConstants.Code39CheckSumType) : void

setEncodingCharacterSet #

Sets the encoding character set for barcode scanning.

Parameters:

encodingCharacterSet: The encoding character set to be set.

Syntax:

TypeScript
setEncodingCharacterSet(encodingCharSet : string) : void

setDatamatrixDpmModeEnabled #

Enables or disables the (DPM) mode for Datamatrix barcodes.

Parameters:

enabled: True to enable DPM mode, false to disable it.

Syntax:

TypeScript
setDatamatrixDpmModeEnabled(enabled : boolean) : void

isDatamatrixDpmModeEnabled #

Retrieves whether Direct Part Marking (DPM) mode for Datamatrix barcodes is enabled.

Syntax:

TypeScript
isDatamatrixDpmModeEnabled(): any

setUpcEanDeblurEnabled #

Enables or disables deblurring for UPC/EAN barcodes.

Parameters:

enabled: True to enable deblurring, false to disable it.

Syntax:

TypeScript
setUpcEanDeblurEnabled(enabled : boolean) : void

setEnableMisshaped1DEnabled #

Enables or disables the decoding of misshaped 1D barcodes.

Parameters:

enabled: True to enable decoding, false to disable it.

Syntax:

TypeScript
setEnableMisshaped1DEnabled(enabled : boolean) : void

setBarcodeTypeEnabled #

Enable the specified barcode types for scanning.

Parameters:

Syntax:

TypeScript
setBarcodeTypeEnabled(decoders: BarkoderConstants.DecoderType[]): void

setEnableVINRestrictions #

Sets whether Vehicle Identification Number (VIN) restrictions are enabled for scanning.

Parameters:

enabled: True to enable VIN restrictions, false to disable them.

Syntax:

TypeScript
setEnableVINRestrictions(enabled: boolean) : void

isBarcodeTypeEnabled #

Checks if a specific barcode type is enabled.

Parameters:

barcode: The barcode type to check.

Syntax:

TypeScript
isBarcodeTypeEnabled(decoder: BarkoderConstants.DecoderType) : boolean

setBarcodeTypeLengthRange #

Sets the length range for a specified barcode type.

Parameters:

decoder: The type of barcode.minimumLength: The minimum length of the barcode.maximumLength: The maximum length of the barcode.

Syntax:

TypeScript
setBarcodeTypeLengthRange(decoder: BarkoderConstants.DecoderType, minimumLength: number, maximumLength: number) : void

getEncodingCharacterSet #

Get the character set used for encoding.

Syntax:

TypeScript
getEncodingCharacterSet() : any

getFormattingType #

Get the formatting type for barcode scanning.

Syntax:

TypeScript
getFormattingType() : any

isUpcEanDeblurEnabled #

Get a value indicating whether deblurring is enabled for UPC/EAN barcodes.

Syntax:

TypeScript
isUpcEanDeblurEnabled() : any

isMisshaped1DEnabled #

Get a value indicating whether decoding of misshaped 1D barcodes is enabled.

Syntax:

TypeScript
isMisshaped1DEnabled() : any

isVINRestrictionsEnabled #

Get a value indicating whether Vehicle Identification Number (VIN) restrictions are enabled for scanning.

Syntax:

TypeScript
isVINRestrictionsEnabled() : any

setCustomOption #

TypeScript
setCustomOption(option: string, value: number): void

Setting custom option.

Parameters:

NameType
stringString
intnumber

setCustomOptionGlobal #

Sets a custom global option with a string option and integer value.

Parameters:

option: the option's name; value: its value.

Syntax:

TypeScript
setCustomOptionGlobal(option: string, value: number): void

setEnableComposite #

TypeScript
setEnableComposite(value): void

Parameters:

NameType
valuenumber

setIdDocumentMasterChecksumEnabled #

TypeScript
setIdDocumentMasterChecksumEnabled(enabled): void

Parameters:

NameType
enabledboolean

setQrDpmModeEnabled #

TypeScript
setQrDpmModeEnabled(enabled): void

Parameters:

NameType
enabledboolean

setQrMicroDpmModeEnabled #

TypeScript
setQrMicroDpmModeEnabled(enabled): void

Parameters:

NameType
enabledboolean

setQrMultiPartMergeEnabled #

TypeScript
setQrMultiPartMergeEnabled(enabled): void

Parameters:

NameType
enabledboolean

setDecoderMatchFilter #

Defines which barcode results the scanner should return as matches.

Parameters:

  • value: A string value that the barcode must match.
TypeScript
setDecoderMatchFilter(value: string): void

setDecoderReturnOnlyMatchedResults #

Sets whether only results matching the configured match filter are returned.

Parameters:

enabled: true to return only matched results.

Syntax:

TypeScript
setDecoderReturnOnlyMatchedResults(enabled: boolean): void

isIdDocumentMasterChecksumEnabled #

TypeScript
isIdDocumentMasterChecksumEnabled()

Retrieves whether Master checksum is enabled when scanning ID Documents.

isQrDpmModeEnabled #

TypeScript
isQrDpmModeEnabled()

Retrieves whether Direct Part Marking (DPM) mode for QR barcodes is enabled.

isQrMicroDpmModeEnabled #

TypeScript
isQrMicroDpmModeEnabled()

Retrieves whether Direct Part Marking (DPM) mode for QR Micro barcodes is enabled.

isQrMultiPartMergeEnabled #

TypeScript
isQrMultiPartMergeEnabled()

Retrieves whether the QR multi-part merge mode is enabled.

DecoderType #

Represents the types of barcodes that are supported by barKoder.

TypeScript
export enum DecoderType {
  Aztec = 0,
  AztecCompact = 1,
  QR = 2,
  QRMicro = 3,
  Code128 = 4,
  Code93 = 5,
  Code39 = 6,
  Codabar = 7,
  Code11 = 8,
  Msi = 9,
  UpcA = 10,
  UpcE = 11,
  UpcE1 = 12,
  Ean13 = 13,
  Ean8 = 14,
  PDF417 = 15,
  PDF417Micro = 16,
  Datamatrix = 17,
  Code25 = 18,
  Interleaved25 = 19,
  ITF14 = 20,
  IATA25 = 21,
  Matrix25 = 22,
  Datalogic25 = 23,
  COOP25 = 24,
  Code32 = 25,
  Telepen = 26,
  Dotcode = 27,
  IDDocument = 28,
  Databar14 = 29,
  DatabarLimited = 30,
  DatabarExpanded = 31,
  PostalIMB = 32,
  Postnet = 33,
  Planet = 34,
  AustralianPost = 35,
  RoyalMail = 36,
  KIX = 37,
  JapanesePost = 38,
  MaxiCode = 39,
  OCRText = 40
}

FormattingType #

TypeScript
export enum FormattingType {
  Disabled = 0,
  Automatic = 1,
  GS1 = 2,
  AAMVA = 3,
    SADL = 4, BCBP = 5
}

Code11ChecksumType #

TypeScript
export enum Code11ChecksumType {
  Disabled = 0,
  Single = 1,
  Double = 2
}

Code39ChecksumType #

TypeScript
export enum Code39ChecksumType {
  Disabled = 0,
  Enabled = 1
}

MsiChecksumType #

TypeScript
export enum MsiChecksumType {
  Disabled = 0,
  Mod10 = 1,
  Mod11 = 2,
  Mod1010 = 3,
  Mod1110 = 4,
  Mod11IBM = 5,
  Mod1110IBM = 6
}

Results #

setCloseSessionOnResultEnabled #

Sets whether the session should be closed upon detecting a result during barcode scanning.

Parameters:

enabled: True to close the session on result detection, false otherwise

Syntax:

TypeScript
setCloseSessionOnResultEnabled(enabled : boolean) : void

setImageResultEnabled #

Enables or disables the display of image results during barcode scanning.

Parameters:

enabled: True to enable image result display, false to disable it.

Syntax:

TypeScript
setImageResultEnabled(enabled : boolean) : void

setBeepOnSuccessEnabled #

Enables or disables the beep sound on successful barcode scanning.

Parameters:

enabled: True to enable beep sound, false to disable it.

Syntax:

TypeScript
setBeepOnSuccessEnabled(enabled : boolean) : void

setVibrateOnSuccessEnabled #

Enables or disables the vibration on successful barcode scanning.

Parameters:

enabled: True to enable vibration, false to disable it.

Syntax:

TypeScript
setVibrateOnSuccessEnabled(enabled : boolean) : void

setBarcodeThumbnailOnResultEnabled #

Enables or disables the display of barcode thumbnails in the scan results.

Parameters:

enabled: True to enable barcode thumbnails, false to disable them.

Syntax:

TypeScript
setBarcodeThumbnailOnResultEnabled(enabled : boolean) : void

setMaximumResultsCount #

Sets the maximum number of results to be returned from barcode scanning.

Parameters:

maximumResultsCount: The maximum number of results to return.

Syntax:

TypeScript
setMaximumResultsCount(maximumResultsCount : number): void

setThresholdBetweenDuplicatesScans #

Sets the threshold between duplicate scans in milliseconds.

Parameters:

thresholdBetweenDuplicatesScans: The threshold between duplicate scans in milliseconds.

Syntax:

TypeScript
setThresholdBetweenDuplicatesScans(thresholdBetweenDuplicatesScans : number) : void

setDuplicatesDelayMs #

Sets the time, in milliseconds, before the same barcode is detected again (continuous scanning).

Parameters:

duplicateDelayMs: the delay in milliseconds.

Syntax:

TypeScript
setDuplicatesDelayMs(duplicateDelayMs: number): void

getDuplicatesDelayMs #

Retrieves the time, in milliseconds, before the same barcode is detected again.

Syntax:

TypeScript
getDuplicatesDelayMs(): any

setMulticodeCachingDuration #

Set the multicode caching duration.

Parameters:

multicodeCachingDuration: multicode caching duration.

Syntax:

TypeScript
setMulticodeCachingDuration(multicodeCachingDuration : number) : void

setMulticodeCachingEnabled #

Set the multicode caching enabled.

Parameters:

multiCodeCachingEnabled: multicode caching enabled.

Syntax:

TypeScript
setMulticodeCachingEnabled(multiCodeCachingEnabled : boolean) : void

getMulticodeCachingEnabled #

Get the multicode caching is enabled.

Syntax:

TypeScript
getMulticodeCachingEnabled() : any

getMulticodeCachingDuration #

Get the multicode caching duration.

Syntax:

TypeScript
getMulticodeCachingDuration() : any

isImageResultEnabled #

Get a value indicating whether image results are enabled.

Syntax:

TypeScript
isImageResultEnabled() : any

isBeepOnSuccessEnabled #

Get a value indicating whether a beep sound is played on successful barcode scanning.

Syntax:

TypeScript
isBeepOnSuccessEnabled() : any

isVibrateOnSuccessEnabled #

Get a value indicating whether vibration is enabled on successful barcode scanning.

Syntax:

TypeScript
isVibrateOnSuccessEnabled() : any

isCloseSessionOnResultEnabled #

Get a value indicating whether the session is closed upon detecting a result during barcode scanning.

Syntax:

TypeScript
isCloseSessionOnResultEnabled() : any

isBarcodeThumbnailOnResultEnabled #

Get a value indicating whether barcode thumbnails are enabled in the scan results.

Syntax:

TypeScript
isBarcodeThumbnailOnResultEnabled() : any

getMaximumResultsCount #

Get the maximum number of results to be returned from barcode scanning.

Syntax:

TypeScript
getMaximumResultsCount() : any

getThresholdBetweenDuplicatesScans #

Get the threshold between duplicate scans in seconds.

Syntax:

TypeScript
getThresholdBetweenDuplicatesScans() : any

captureImage #

Captures the latest camera frame.

Syntax:

TypeScript
captureImage()

scanImage #

Scan from base64 image string.

Parameters:

base64: String.

resultsCallback: ResultCalllBack.

Syntax:

TypeScript
scanImage(base64, resultsCallback)

setResultDisappearanceDelayMs #

TypeScript
setResultDisappearanceDelayMs(value): void

Parameters:

NameType
valuenumber

setShowDuplicatesLocations #

TypeScript
setShowDuplicatesLocations(value): void

Enables or disables showing duplicate barcode locations on the preview overlay.

Parameters:

NameType
valueboolean

getResultDisappearanceDelayMs #

TypeScript
getResultDisappearanceDelayMs()

Retrieves the delay after which AR results disappear once detected.

getShowDuplicatesLocations #

TypeScript
getShowDuplicatesLocations()

Retrieves whether showing duplicate barcode locations in the AR view is enabled.

BarkoderResultCallback #

Represents a callback for handling barcode scanning events. Called when barcode scanning has finished.

TypeScript
export interface BarkoderResultCallback {
  scanningFinished(results: any[], thumbnails: any[], resultImage: any): void;
}

Results

  • textualData: The textual data encoded in the barcode.
  • barcodeTypeName: The type name of the barcode.
  • characterSet: The character set used in encoding the barcode.

Region & overlay #

setRegionOfInterestVisible #

Sets the visibility of the region of interest (ROI) overlay for barcode scanning.

Parameters:

visible: True to make the ROI visible, false to hide it.

Syntax:

TypeScript
setRegionOfInterestVisible(visible : boolean) : void

isRegionOfInterestVisible #

Checks whether the Region of Interest (ROI) is visible on the camera preview.

Syntax:

TypeScript
isRegionOfInterestVisible(): any

setLocationInImageResultEnabled #

Enables or disables displaying the barcode location in the image result.

Parameters:

enabled: True to display the location, false to hide it.

Syntax:

TypeScript
setLocationInImageResultEnabled(enabled : boolean) : void

setLocationLineColor #

Sets the color of the line indicating the barcode location in the camera preview.

Parameters:

hexColor: The hexadecimal representation of the color.

Syntax:

TypeScript
setLocationLineColor(hexColor : string) : void

setLocationLineWidth #

Sets the width of the line indicating the barcode location in the camera preview.

Parameters:

width: The width representation of the location line.

Syntax:

TypeScript
setLocationLineWidth(width : number) : void

setRoiLineColor #

Sets the color of the line indicating the region of interest (ROI) in the camera preview.

Parameters:

hexColor: The hexadecimal representation of the color.

Syntax:

TypeScript
setRoiLineColor(hexColor : string) : void

setRoiLineWidth #

Sets the width of the line indicating the region of interest (ROI) in the camera preview.

Parameters:

roiLineWidth: The number representation of the width.

Syntax:

TypeScript
setRoiLineWidth(roiLineWidth : number) : void

setRoiOverlayBackgroundColor #

Sets the background color of the region of interest (ROI) overlay in the camera preview.

Parameters:

hexColor: The hexadecimal representation of the color.

Syntax:

TypeScript
setRoiOverlayBackgroundColor(hexColor : string) : void

setRegionOfInterest #

Sets the region of interest (ROI) for barcode scanning within the camera preview.

Parameters:

left: The left coordinate of the ROI.top: The top coordinate of the ROI.width: The width of the ROI.height: The height of the ROI.

Syntax:

TypeScript
setRegionOfInterest(left : number, top : number, width : number, height : number) : void

getRegionOfInterest #

Gets or sets a value indicating whether the region of interest (ROI) overlay is visible.

Syntax:

TypeScript
getRegionOfInterest() : any

getLocationLineColorHex #

Get the hexadecimal representation of the location line color

Syntax:

TypeScript
getLocationLineColorHex() : any

getRoiLineColorHex #

Get the hexadecimal representation of the region of interest (ROI) line color.

Syntax:

TypeScript
getRoiLineColorHex() : any

getRoiOverlayBackgroundColorHex #

Get the hexadecimal representation of the region of interest (ROI) overlay background color.

Syntax:

TypeScript
getRoiOverlayBackgroundColorHex() : any

getLocationLineWidth #

Get the width of the location line.

Syntax:

TypeScript
getLocationLineWidth() : any

getRoiLineWidth #

Get the width of the region of interest (ROI) line.

Syntax:

TypeScript
getRoiLineWidth() : any

isLocationInImageResultEnabled #

Get a value indicating whether the location is displayed in image results.

Syntax:

TypeScript
isLocationInImageResultEnabled() : any

setScanningIndicatorAlwaysVisible #

TypeScript
setScanningIndicatorAlwaysVisible(value): void

Parameters:

NameType
valueboolean

setScanningIndicatorColor #

TypeScript
setScanningIndicatorColor(value): void

Parameters:

NameType
hexColorString

setScanningIndicatorWidth #

TypeScript
setScanningIndicatorWidth(lineWidth): void

Parameters:

NameType
lineWidthnumber

setScanningIndicatorAnimation #

TypeScript
setScanningIndicatorAnimation(animation): void

Parameters:

NameType
animationnumber

getScanningIndicatorColorHex #

TypeScript
getScanningIndicatorColorHex()

Retrieves the hexadecimal color code representing the line color of the scanning indicator on the camera preview.

getScanningIndicatorWidth #

TypeScript
getScanningIndicatorWidth()

Retrieves the current width setting for the scanning indicator on the camera preview.

getScanningIndicatorAnimation #

TypeScript
getScanningIndicatorAnimation()

Retrieves the current animation setting for the scanning indicator on the camera preview.

isScanningIndicatorAlwaysVisible #

TypeScript
isScanningIndicatorAlwaysVisible()

Retrieves if the scanning indicator is set to be always visible on the camera preview.

setRoiCenterMark #

Sets the center mark displayed in the scanner's Region of Interest (ROI). The barcode scanner will scan only within the ROI, with the selected center mark indicating the center of the scanning area.

TypeScript
setRoiCenterMark(roiCenterMark: BarkoderConstants.BarkoderRoiCenterMark): void

getRoiCenterMark #

Returns the currently configured ROI center mark.

TypeScript
getRoiCenterMark() : BarkoderRoiCenterMark

BarkoderRoiCenterMark #

TypeScript
export enum BarkoderRoiCenterMark {
  NONE = 0,
  CROSSHAIR = 1,
  POINT = 2
}

AR mode #

setBarkoderARMode #

TypeScript
setBarkoderARMode(value): void

Sets the AR mode used for barcode scanning visualization.

Parameters:

NameType
valueBarkoderARMode

resetARCache #

Clears all cached barcode results from the current AR scanning session.

Syntax:

TypeScript
resetARCache(): void

setARLocationTransitionSpeed #

TypeScript
setARLocationTransitionSpeed(value): void

Parameters:

NameType
valuenumber

setAROverlayRefresh #

TypeScript
setAROverlayRefresh(value): void

Parameters:

NameType
valueBarkoderAROverlayRefresh

setARSelectedLocationColor #

TypeScript
setARSelectedLocationColor(value): void

Parameters:

NameType
hexColorstring

setARNonSelectedLocationColor #

TypeScript
setARNonSelectedLocationColor(value): void

Parameters:

NameType
hexColorstring

setARSelectedLocationLineWidth #

TypeScript
setARSelectedLocationLineWidth(value): void

Parameters:

NameType
valuenumber

setARNonSelectedLocationLineWidth #

TypeScript
setARNonSelectedLocationLineWidth(value): void

Parameters:

NameType
valuenumber

setARLocationType #

TypeScript
setARLocationType(value): void

Parameters:

NameType
valueBarkoderARLocationType

setARDoubleTapToFreezeEnabled #

TypeScript
setARDoubleTapToFreezeEnabled(enabled): void

Parameters:

NameType
enabledboolean

setARImageResultEnabled #

TypeScript
setARImageResultEnabled(enabled): void

Parameters:

NameType
enabledboolean

setARBarcodeThumbnailOnResultEnabled #

TypeScript
setARBarcodeThumbnailOnResultEnabled(enabled): void

Parameters:

NameType
enabledboolean

setARResultLimit #

TypeScript
setARResultLimit(value): void

Parameters:

NameType
valuenumber

setARContinueScanningOnLimit #

TypeScript
setARContinueScanningOnLimit(value): void

Parameters:

NameType
valueboolean

setAREmitResultsAtSessionEndOnly #

TypeScript
setAREmitResultsAtSessionEndOnly(value): void

Parameters:

NameType
valueboolean

setARReturnOnlyMatchedResults #

Controls whether only matched results are returned in AR match filter mode. If false, all detected results are returned, while unmatched results have isMatched set to false. This option only applies when AR mode is MatchFilter and a match filter is active.

Parameters:

enabled: true to return only matched results.

Syntax:

TypeScript
setARReturnOnlyMatchedResults(enabled: boolean): void

setARDisplayOnlyMatchedResults #

Controls whether only matched results are displayed in AR match filter mode. If false, all decoded results are displayed, including unmatched results. This option only applies when AR mode is MatchFilter and a match filter is active.

Parameters:

enabled: true to display only matched results.

Syntax:

TypeScript
setARDisplayOnlyMatchedResults(enabled: boolean): void

setARHeaderHeight #

TypeScript
setARHeaderHeight(value): void

Parameters:

NameType
valuenumber

setARHeaderShowMode #

TypeScript
setARHeaderShowMode(value): void

Parameters:

NameType
valueBarkoderARHeaderShowMode

setARHeaderMaxTextHeight #

TypeScript
setARHeaderMaxTextHeight(value): void

Parameters:

NameType
valuenumber

setARHeaderMinTextHeight #

TypeScript
setARHeaderMinTextHeight(value): void

Parameters:

NameType
valuenumber

setARHeaderTextColorSelected #

TypeScript
setARHeaderTextColorSelected(value): void

Parameters:

NameType
hexColorstring

setARHeaderTextColorNonSelected #

TypeScript
setARHeaderTextColorNonSelected(value): void

Parameters:

NameType
hexColorstring

setARHeaderHorizontalTextMargin #

TypeScript
setARHeaderHorizontalTextMargin(value): void

Parameters:

NameType
valuenumber

setARHeaderVerticalTextMargin #

TypeScript
setARHeaderVerticalTextMargin(value): void

Parameters:

NameType
valuenumber

setARHeaderTextFormat #

TypeScript
setARHeaderTextFormat(value): void

Parameters:

NameType
valuestring

getBarkoderARMode #

TypeScript
getBarkoderARMode()

Retrieves the current AR mode used for barcode scanning.

getARLocationTransitionSpeed #

TypeScript
getARLocationTransitionSpeed()

Retrieves the transition speed for AR barcode location overlays.

getAROverlayRefresh #

TypeScript
getAROverlayRefresh()

Retrieves the AR overlay refresh mode.

getARSelectedLocationColor #

TypeScript
getARSelectedLocationColor()

Retrieves the color used for selected barcode overlays in AR mode.

getARNonSelectedLocationColor #

TypeScript
getARNonSelectedLocationColor()

Retrieves the color used for non-selected barcode overlays in AR mode.

getARSelectedLocationLineWidth #

TypeScript
getARSelectedLocationLineWidth()

Retrieves the line width for selected barcode overlays in AR mode.

getARNonSelectedLocationLineWidth #

TypeScript
getARNonSelectedLocationLineWidth()

Retrieves the line width for non-selected barcode overlays in AR mode.

getARLocationType #

TypeScript
getARLocationType()

Retrieves the style of AR location overlays (tight, bounding box, none).

getARResultLimit #

TypeScript
getARResultLimit()

Retrieves the maximum number of results allowed in a single AR scanning session.

getARContinueScanningOnLimit #

TypeScript
getARContinueScanningOnLimit()

Retrieves whether scanning continues when the result limit is reached (only in .interactiveDisabled mode).

getAREmitResultsAtSessionEndOnly #

TypeScript
getAREmitResultsAtSessionEndOnly()

Retrieves whether results are emitted only at AR session end (or when the limit is reached).

getARReturnOnlyMatchedResults #

Retrieves whether only matched results are returned in AR match filter mode.

Syntax:

TypeScript
getARReturnOnlyMatchedResults(): any

getARDisplayOnlyMatchedResults #

Retrieves whether only matched results are displayed in AR match filter mode.

Syntax:

TypeScript
getARDisplayOnlyMatchedResults(): any

getARHeaderHeight #

TypeScript
getARHeaderHeight()

Retrieves the header height above barcode in AR mode.

getBarkoderARHeaderShowMode #

TypeScript
getBarkoderARHeaderShowMode()

Retrieves the header display mode (always, on selected, never).

getARHeaderMaxTextHeight #

TypeScript
getARHeaderMaxTextHeight()

Retrieves the maximum text height for AR headers.

getARHeaderMinTextHeight #

TypeScript
getARHeaderMinTextHeight()

Retrieves the minimum text height for AR headers.

getARHeaderTextColorSelected #

TypeScript
getARHeaderTextColorSelected()

Retrieves the header text color for selected barcodes.

getARHeaderTextColorNonSelected #

TypeScript
getARHeaderTextColorNonSelected()

Retrieves the header text color for non-selected barcodes.

getARHeaderHorizontalTextMargin #

TypeScript
getARHeaderHorizontalTextMargin()

Retrieves the horizontal margin for AR header text.

getARHeaderVerticalTextMargin #

TypeScript
getARHeaderVerticalTextMargin()

Retrieves the vertical margin for AR header text.

getARHeaderTextFormat #

TypeScript
getARHeaderTextFormat()

Retrieves the format string used for AR header text.

isARDoubleTapToFreezeEnabled #

TypeScript
isARDoubleTapToFreezeEnabled()

Checks whether double-tap to freeze is enabled in AR mode.

isARImageResultEnabled #

TypeScript
isARImageResultEnabled()

Retrieves whether image result is enabled for AR mode.

isARBarcodeThumbnailOnResultEnabled #

TypeScript
isARBarcodeThumbnailOnResultEnabled()

Retrieves whether barcode thumbnail on result is enabled for AR mode.

BarkoderARMode #

The AR mode setBarkoderARMode takes.

TypeScript
export enum BarkoderARMode {
  OFF = 0,
  InteractiveDisabled = 1,
  InteractiveEnabled = 2,
  NonInteractive = 3,
  MatchFilter = 4
}

BarkoderAROverlayRefresh #

How AR overlays refresh.

TypeScript
export enum BarkoderAROverlayRefresh {
  SMOOTH = 0,
  NORMAL = 1
}

BarkoderARLocationType #

The style of AR location overlays.

TypeScript
export enum BarkoderARLocationType {
  NONE = 0,
  TIGHT = 1,
  BOUNDINGBOX = 2
}

BarkoderARHeaderShowMode #

When AR headers show.

TypeScript
export enum BarkoderARHeaderShowMode {
  NEVER = 0,
  ALWAYS = 1,
  ONSELECTED = 2
}