barKoder SDK for NativeScript API Reference

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

Methods #

startCamera() #

Starts the camera for barcode scanning.

Syntax:

                startCamera() : void
            

startScanning() #

Starts scanning for barcodes.

Parameters #

BarkoderResultCallback: The callback that will handle barcode scanning events.

Syntax:

                startScanning(BarkoderResultCallback : BarkoderConstants.BarkoderResultCallback) : void
            

stopScanning() #

Stops the barcode scanning process.

Syntax:

                stopScanning() : void
            

pauseScanning() #

Pauses the barcode scanning process.

Syntax:

                pauseScanning() : void
            

setLicenseKey() #

Set your actual license key provided by the plugin.

Parameters #

licenseKey: license key.

Syntax:

                setLicenseKey(licenseKey : string) : void
            

setFlashEnabled() #

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

Parameters #

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

Syntax:

                setFlashEnabled(enabled : boolean) : void
            

setZoomFactor() #

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

Parameters #

zoomFactor: The zoom factor to set.

Syntax:

                setZoomFactor(zoomFactor : 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:

                setPinchToZoomEnabled(enabled : boolean) : void
            

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:

                setRegionOfInterestVisible(visible : boolean) : void
            

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:

                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:

                setImageResultEnabled(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:

                setLocationInPreviewEnabled(enabled : boolean) : void
            

setLocationInImageResultEnabled() #

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

Parameters #

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

Syntax:

                setLocationInImageResultEnabled(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:

                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:

                setVibrateOnSuccessEnabled(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:

                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:

                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:

                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:

                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:

                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:

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

setBarkoderResolution() #

Sets the resolution for barcode scanning.

Parameters #

barkoderResolution: The barkoder resolution to be set.

Syntax:

                setBarkoderResolution(barkoderResolution : BarkoderConstants.BarkoderResolution) : void
            

setDecodingSpeed() #

Sets the decoding speed for barcode scanning.

Parameters #

decodingSpeed: The decoding speed to be set.

Syntax:

                setDecodingSpeed(decodingSpeed : BarkoderConstants.DecodingSpeed) : void
            

setFormattingType() #

Sets the formatting type for barcode scanning.

Parameters #

formattingType: The formatting type to be set.

Syntax:

                setFormattingType(formattingType : BarkoderConstants.FormattingType) : void
            

setMsiChecksumType() #

Sets the checksum type for MSI barcodes.

Parameters #

msiChecksumType: The MSI checksum type to be set.

Syntax:

                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:

                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:

                setCode39ChecksumType(code39ChecksumType : BarkoderConstants.Code39CheckSumType) : void
            

setEncodingCharacterSet() #

Sets the encoding character set for barcode scanning.

Parameters #

encodingCharacterSet: The encoding character set to be set.

Syntax:

                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:

                setDatamatrixDpmModeEnabled(enabled : boolean) : void
            

setUpcEanDeblurEnabled() #

Enables or disables deblurring for UPC/EAN barcodes.

Parameters #

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

Syntax:

                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:

                setEnableMisshaped1DEnabled(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:

                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:

                setMaximumResultsCount(maximumResultsCount : number): void
            

setDuplicatesDelayMs() #

Sets the delay in milliseconds for considering duplicate barcodes during scanning.

Parameters #

duplicatesDelayMs: The delay in milliseconds for duplicate detection.

Syntax:

                setDuplicatesDelayMs(duplicateDelayMs : number) : void
            

setBarcodeTypeEnabled() #

Enable the specified barcode types for scanning.

Parameters #

Syntax:

                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:

                setEnableVINRestrictions(enabled: boolean) : void
            

setThresholdBetweenDuplicatesScans() #

Sets the threshold between duplicate scans in milliseconds.

Parameters #

thresholdBetweenDuplicatesScans: The threshold between duplicate scans in milliseconds.

Syntax:

                setThresholdBetweenDuplicatesScans(thresholdBetweenDuplicatesScans : number) : void
            

setThreadsLimit() #

Set the threads limit.

Parameters #

threadsLimit: The threads limit.

Syntax:

                setThreadsLimit(threadsLimit : number) : void
            

setMulticodeCachingDuration() #

Set the multicode caching duration.

Parameters #

multicodeCachingDuration: multicode caching duration.

Syntax:

                setMulticodeCachingDuration(multicodeCachingDuration : number) : void
            

setMulticodeCachingEnabled() #

Set the multicode caching enabled.

Parameters #

multiCodeCachingEnabled: multicode caching enabled.

Syntax:

                setMulticodeCachingEnabled(multiCodeCachingEnabled : boolean) : void
            

getMulticodeCachingEnabled() #

Get the multicode caching is enabled.

Syntax:

                getMulticodeCachingEnabled() : any
            

getMulticodeCachingDuration() #

Get the multicode caching duration.

Syntax:

                getMulticodeCachingDuration() : any
            

isBarcodeTypeEnabled() #

Checks if a specific barcode type is enabled.

Parameters #

barcode: The barcode type to check.

Syntax:

                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:

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

configureBarkoder() #

Set the config for a Barkoder.

Syntax:

                configureBarkoder(config: BarkoderConstants.BarkoderConfig): void
            

getVersion() : any #

Gets barKoder SDK version.

Syntax:

                getVersion() : any
            

getRegionOfInterest() #

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

Syntax:

                getRegionOfInterest() : any
            

isFlashAvailable() #

Get a value indicating whether the flash is available.

Syntax:

                isFlashAvailable(callback : BarkoderConstants.FlashAvailableCallback): Promise<boolean>
            

getMaxZoomFactor() #

Get the maximum zoom factor

Syntax:

                getMaxZoomFactor(callback : BarkoderConstants.MaxZoomAvailableCallback): Promise<number>
            

getLocationLineColorHex() #

Get the hexadecimal representation of the location line color

Syntax:

                getLocationLineColorHex() : any
            

getRoiLineColor() #

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

Syntax:

                getRoiLineColor() : any
            

getRoiOverlayBackgroundColorHex() #

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

Syntax:

                getRoiOverlayBackgroundColorHex() : any
            

getEncodingCharacterSet() #

Get the character set used for encoding.

Syntax:

                getEncodingCharacterSet() : any
            

getLocationLineWidth() #

Get the width of the location line.

Syntax:

                getLocationLineWidth() : any
            

getRoiLineWidth() #

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

Syntax:

                getRoiLineWidth() : any
            

isImageResultEnabled() #

Get a value indicating whether image results are enabled.

Syntax:

                isImageResultEnabled() : any
            

isLocationInImageResultEnabled() #

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

Syntax:

                isLocationInImageResultEnabled() : any
            

isLocationInPreviewEnabled() #

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

Syntax:

                isLocationInPreviewEnabled() : any
            

isPinchToZoomEnabled() #

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

Syntax:

                isPinchToZoomEnabled() : any
            

isBeepOnSuccessEnabled() #

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

Syntax:

                isBeepOnSuccessEnabled() : any
            

isVibrateOnSuccessEnabled() #

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

Syntax:

                isVibrateOnSuccessEnabled() : any
            

isCloseSessionOnResultEnabled() #

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

Syntax:

                isCloseSessionOnResultEnabled() : any
            

getBarkoderResolution() #

Get the resolution for barcode scanning.

Syntax:

                getBarkoderResolution() : any
            

getDecodingSpeed() #

Get the decoding speed for barcode scanning.

Syntax:

                getDecodingSpeed() : any
            

getFormattingType() #

Get the formatting type for barcode scanning.

Syntax:

                getFormattingType() : any
            

getMsiCheckSumType() #

Get the checksum type for MSI barcodes.

Syntax:

                getMsiCheckSumType() : any
            

getCode11CheckSumType() #

Get the checksum type for Code 11 barcodes.

Syntax:

                getCode11CheckSumType() : any
            

getCode39CheckSumType() #

Get the checksum type for Code 39 barcodes.

Syntax:

                getCode39CheckSumType() : any
            

isUpcEanDeblurEnabled() #

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

Syntax:

                isUpcEanDeblurEnabled() : any
            

isMisshaped1DEnabled() #

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

Syntax:

                isMisshaped1DEnabled() : any
            

isBarcodeThumbnailOnResultEnabled() : any #

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

Syntax:

                isBarcodeThumbnailOnResultEnabled() : any
            

getMaximumResultsCount() #

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

Syntax:

                getMaximumResultsCount() : any
            

getDuplicatesDelayMs() #

Get the delay in milliseconds for considering duplicate barcodes during scanning.

Syntax:

                getDuplicatesDelayMs() : any
            

isVINRestrictionsEnabled() #

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

Syntax:

                isVINRestrictionsEnabled() : any
            

getThresholdBetweenDuplicatesScans() #

Get the threshold between duplicate scans in seconds.

Syntax:

                getThresholdBetweenDuplicatesScans() : any
            

getThreadsLimit() #

Get the threads limit.

Syntax:

                getThreadsLimit() : any
            

Models, enums, interfaces #

BarkoderResultCallback #

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

                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.

DecoderType #

Represents the types of barcodes that are supported by barKoder.

                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
}
            

BarkoderResolution #

                export enum BarkoderResolution {
  NORMAL = 'HD',
  HIGH = 'Full HD'
}
            

DecodingSpeed #

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

FormattingType #

                export enum FormattingType {
  Disabled = 0,
  Automatic = 1,
  GS1 = 2,
  AAMVA = 3
}
            

Code11ChecksumType #

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

Code39ChecksumType #

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

MsiChecksumType #

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

Page Contents

History:

close