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:
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
setDecodingSpeed #
Sets the decoding speed for barcode scanning.
Parameters:
decodingSpeed: The decoding speed to be set.
Syntax:
setDecodingSpeed(decodingSpeed : BarkoderConstants.DecodingSpeed) : void
setThreadsLimit #
Set the threads limit.
Parameters:
threadsLimit: The threads limit.
Syntax:
setThreadsLimit(threadsLimit : number) : void
configureBarkoder #
Set the config for a Barkoder.
Syntax:
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.
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:
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):
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.
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:
getVersion() : any
getDecodingSpeed #
Get the decoding speed for barcode scanning.
Syntax:
getDecodingSpeed() : 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
getThreadsLimit #
Get the threads limit.
Syntax:
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:
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:
unfreezeScanning()
setUPCEexpandToUPCA #
setUPCEexpandToUPCA(enabled): void
Sets whether the UPC-E barcodes should be expanded to UPC-A format.
Parameters:
| Name | Type |
|---|---|
| enabled | boolean |
setUPCE1expandToUPCA #
setUPCE1expandToUPCA(enabled): void
Sets whether the UPC-E1 barcodes should be expanded to UPC-A format.
Parameters:
| Name | Type |
|---|---|
| enabled | boolean |
setPowerSavingMode #
setPowerSavingMode(powerSavingMode): void
Power saving mode level. Higher values reduce CPU/battery usage by limiting frame processing.
0 - Disabled (full performance)
1 - Light saving
2 - Medium saving
3 - High saving
4 - Maximum saving
Parameters:
| Name | Type |
|---|---|
| powerSavingMode | number |
setVideoStabilization #
setVideoStabilization(value): void
Enable or disable video stabilization for smoother video capture.
Parameters:
| Name | Type |
|---|---|
| value | boolean |
selectVisibleBarcodes #
Selects all barcodes that are currently visible in AR mode.
Syntax:
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:
setDynamicExposure(value: number): void
getPowerSavingMode #
getPowerSavingMode()
Retrieves the power saving mode level.
Models, #
DecodingSpeed #
export enum DecodingSpeed {
Fast = 0,
Normal = 1,
Slow = 2,
Rigorous = 3
}
Camera #
startCamera #
Starts the camera for barcode scanning.
Syntax:
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:
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:
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:
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:
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:
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:
setLocationInPreviewEnabled(enabled : boolean) : void
setBarkoderResolution #
Sets the resolution for barcode scanning.
Parameters:
barkoderResolution: The barkoder resolution to be set.
Syntax:
setBarkoderResolution(barkoderResolution : BarkoderConstants.BarkoderResolution) : void
isFlashAvailable #
Get a value indicating whether the flash is available.
Syntax:
isFlashAvailable(callback : BarkoderConstants.FlashAvailableCallback): void
getMaxZoomFactor #
Get the maximum zoom factor
Syntax:
getMaxZoomFactor(callback : BarkoderConstants.MaxZoomAvailableCallback): void
getCurrentZoomFactor #
Retrieves the current zoom factor for the device's camera.
Syntax:
getCurrentZoomFactor(): 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
getBarkoderResolution #
Get the resolution for barcode scanning.
Syntax:
getBarkoderResolution() : any
setPreviewMirrored #
Controls whether the front camera preview is horizontally mirrored.
Parameters:
mirrored: true to mirror it (the default when left out).
Syntax:
setPreviewMirrored(mirrored: boolean): void
isPreviewMirrored #
Retrieves whether the front camera preview is horizontally mirrored.
Syntax:
isPreviewMirrored(): boolean
setCamera #
setCamera(value): void
Parameters:
| Name | Type |
|---|---|
| value | number |
BarkoderCameraPosition #
The camera setCamera uses.
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:
setCentricFocusAndExposure(enabled: boolean): void
BarkoderResolution #
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:
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:
getSadlImageFromExtra(extra: any): ImageSource | null
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
isDatamatrixDpmModeEnabled #
Retrieves whether Direct Part Marking (DPM) mode for Datamatrix barcodes is enabled.
Syntax:
isDatamatrixDpmModeEnabled(): any
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
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
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
getEncodingCharacterSet #
Get the character set used for encoding.
Syntax:
getEncodingCharacterSet() : any
getFormattingType #
Get the formatting type for barcode scanning.
Syntax:
getFormattingType() : 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
isVINRestrictionsEnabled #
Get a value indicating whether Vehicle Identification Number (VIN) restrictions are enabled for scanning.
Syntax:
isVINRestrictionsEnabled() : any
setCustomOption #
setCustomOption(option: string, value: number): void
Setting custom option.
Parameters:
| Name | Type |
|---|---|
| string | String |
| int | number |
setCustomOptionGlobal #
Sets a custom global option with a string option and integer value.
Parameters:
option: the option's name; value: its value.
Syntax:
setCustomOptionGlobal(option: string, value: number): void
setEnableComposite #
setEnableComposite(value): void
Parameters:
| Name | Type |
|---|---|
| value | number |
setIdDocumentMasterChecksumEnabled #
setIdDocumentMasterChecksumEnabled(enabled): void
Parameters:
| Name | Type |
|---|---|
| enabled | boolean |
setQrDpmModeEnabled #
setQrDpmModeEnabled(enabled): void
Parameters:
| Name | Type |
|---|---|
| enabled | boolean |
setQrMicroDpmModeEnabled #
setQrMicroDpmModeEnabled(enabled): void
Parameters:
| Name | Type |
|---|---|
| enabled | boolean |
setQrMultiPartMergeEnabled #
setQrMultiPartMergeEnabled(enabled): void
Parameters:
| Name | Type |
|---|---|
| enabled | boolean |
setDecoderMatchFilter #
Defines which barcode results the scanner should return as matches.
Parameters:
-
value: A string value that the barcode must match.
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:
setDecoderReturnOnlyMatchedResults(enabled: boolean): void
isIdDocumentMasterChecksumEnabled #
isIdDocumentMasterChecksumEnabled()
Retrieves whether Master checksum is enabled when scanning ID Documents.
isQrDpmModeEnabled #
isQrDpmModeEnabled()
Retrieves whether Direct Part Marking (DPM) mode for QR barcodes is enabled.
isQrMicroDpmModeEnabled #
isQrMicroDpmModeEnabled()
Retrieves whether Direct Part Marking (DPM) mode for QR Micro barcodes is enabled.
isQrMultiPartMergeEnabled #
isQrMultiPartMergeEnabled()
Retrieves whether the QR multi-part merge mode is enabled.
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,
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 #
export enum FormattingType {
Disabled = 0,
Automatic = 1,
GS1 = 2,
AAMVA = 3,
SADL = 4, BCBP = 5
}
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
}
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:
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
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
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
setThresholdBetweenDuplicatesScans #
Sets the threshold between duplicate scans in milliseconds.
Parameters:
thresholdBetweenDuplicatesScans: The threshold between duplicate scans in milliseconds.
Syntax:
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:
setDuplicatesDelayMs(duplicateDelayMs: number): void
getDuplicatesDelayMs #
Retrieves the time, in milliseconds, before the same barcode is detected again.
Syntax:
getDuplicatesDelayMs(): any
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
isImageResultEnabled #
Get a value indicating whether image results are enabled.
Syntax:
isImageResultEnabled() : 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
isBarcodeThumbnailOnResultEnabled #
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
getThresholdBetweenDuplicatesScans #
Get the threshold between duplicate scans in seconds.
Syntax:
getThresholdBetweenDuplicatesScans() : any
captureImage #
Captures the latest camera frame.
Syntax:
captureImage()
scanImage #
Scan from base64 image string.
Parameters:
base64: String.
resultsCallback: ResultCalllBack.
Syntax:
scanImage(base64, resultsCallback)
setResultDisappearanceDelayMs #
setResultDisappearanceDelayMs(value): void
Parameters:
| Name | Type |
|---|---|
| value | number |
setShowDuplicatesLocations #
setShowDuplicatesLocations(value): void
Enables or disables showing duplicate barcode locations on the preview overlay.
Parameters:
| Name | Type |
|---|---|
| value | boolean |
getResultDisappearanceDelayMs #
getResultDisappearanceDelayMs()
Retrieves the delay after which AR results disappear once detected.
getShowDuplicatesLocations #
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.
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:
setRegionOfInterestVisible(visible : boolean) : void
isRegionOfInterestVisible #
Checks whether the Region of Interest (ROI) is visible on the camera preview.
Syntax:
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:
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:
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
getRegionOfInterest #
Gets or sets a value indicating whether the region of interest (ROI) overlay is visible.
Syntax:
getRegionOfInterest() : any
getLocationLineColorHex #
Get the hexadecimal representation of the location line color
Syntax:
getLocationLineColorHex() : any
getRoiLineColorHex #
Get the hexadecimal representation of the region of interest (ROI) line color.
Syntax:
getRoiLineColorHex() : any
getRoiOverlayBackgroundColorHex #
Get the hexadecimal representation of the region of interest (ROI) overlay background color.
Syntax:
getRoiOverlayBackgroundColorHex() : 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
isLocationInImageResultEnabled #
Get a value indicating whether the location is displayed in image results.
Syntax:
isLocationInImageResultEnabled() : any
setScanningIndicatorAlwaysVisible #
setScanningIndicatorAlwaysVisible(value): void
Parameters:
| Name | Type |
|---|---|
| value | boolean |
setScanningIndicatorColor #
setScanningIndicatorColor(value): void
Parameters:
| Name | Type |
|---|---|
| hexColor | String |
setScanningIndicatorWidth #
setScanningIndicatorWidth(lineWidth): void
Parameters:
| Name | Type |
|---|---|
| lineWidth | number |
setScanningIndicatorAnimation #
setScanningIndicatorAnimation(animation): void
Parameters:
| Name | Type |
|---|---|
| animation | number |
getScanningIndicatorColorHex #
getScanningIndicatorColorHex()
Retrieves the hexadecimal color code representing the line color of the scanning indicator on the camera preview.
getScanningIndicatorWidth #
getScanningIndicatorWidth()
Retrieves the current width setting for the scanning indicator on the camera preview.
getScanningIndicatorAnimation #
getScanningIndicatorAnimation()
Retrieves the current animation setting for the scanning indicator on the camera preview.
isScanningIndicatorAlwaysVisible #
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.
setRoiCenterMark(roiCenterMark: BarkoderConstants.BarkoderRoiCenterMark): void
getRoiCenterMark #
Returns the currently configured ROI center mark.
getRoiCenterMark() : BarkoderRoiCenterMark
BarkoderRoiCenterMark #
export enum BarkoderRoiCenterMark {
NONE = 0,
CROSSHAIR = 1,
POINT = 2
}
AR mode #
setBarkoderARMode #
setBarkoderARMode(value): void
Sets the AR mode used for barcode scanning visualization.
Parameters:
| Name | Type |
|---|---|
| value | BarkoderARMode |
resetARCache #
Clears all cached barcode results from the current AR scanning session.
Syntax:
resetARCache(): void
setARLocationTransitionSpeed #
setARLocationTransitionSpeed(value): void
Parameters:
| Name | Type |
|---|---|
| value | number |
setAROverlayRefresh #
setAROverlayRefresh(value): void
Parameters:
| Name | Type |
|---|---|
| value | BarkoderAROverlayRefresh |
setARSelectedLocationColor #
setARSelectedLocationColor(value): void
Parameters:
| Name | Type |
|---|---|
| hexColor | string |
setARNonSelectedLocationColor #
setARNonSelectedLocationColor(value): void
Parameters:
| Name | Type |
|---|---|
| hexColor | string |
setARSelectedLocationLineWidth #
setARSelectedLocationLineWidth(value): void
Parameters:
| Name | Type |
|---|---|
| value | number |
setARNonSelectedLocationLineWidth #
setARNonSelectedLocationLineWidth(value): void
Parameters:
| Name | Type |
|---|---|
| value | number |
setARLocationType #
setARLocationType(value): void
Parameters:
| Name | Type |
|---|---|
| value | BarkoderARLocationType |
setARDoubleTapToFreezeEnabled #
setARDoubleTapToFreezeEnabled(enabled): void
Parameters:
| Name | Type |
|---|---|
| enabled | boolean |
setARImageResultEnabled #
setARImageResultEnabled(enabled): void
Parameters:
| Name | Type |
|---|---|
| enabled | boolean |
setARBarcodeThumbnailOnResultEnabled #
setARBarcodeThumbnailOnResultEnabled(enabled): void
Parameters:
| Name | Type |
|---|---|
| enabled | boolean |
setARResultLimit #
setARResultLimit(value): void
Parameters:
| Name | Type |
|---|---|
| value | number |
setARContinueScanningOnLimit #
setARContinueScanningOnLimit(value): void
Parameters:
| Name | Type |
|---|---|
| value | boolean |
setAREmitResultsAtSessionEndOnly #
setAREmitResultsAtSessionEndOnly(value): void
Parameters:
| Name | Type |
|---|---|
| value | boolean |
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:
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:
setARDisplayOnlyMatchedResults(enabled: boolean): void
setARHeaderHeight #
setARHeaderHeight(value): void
Parameters:
| Name | Type |
|---|---|
| value | number |
setARHeaderShowMode #
setARHeaderShowMode(value): void
Parameters:
| Name | Type |
|---|---|
| value | BarkoderARHeaderShowMode |
setARHeaderMaxTextHeight #
setARHeaderMaxTextHeight(value): void
Parameters:
| Name | Type |
|---|---|
| value | number |
setARHeaderMinTextHeight #
setARHeaderMinTextHeight(value): void
Parameters:
| Name | Type |
|---|---|
| value | number |
setARHeaderTextColorSelected #
setARHeaderTextColorSelected(value): void
Parameters:
| Name | Type |
|---|---|
| hexColor | string |
setARHeaderTextColorNonSelected #
setARHeaderTextColorNonSelected(value): void
Parameters:
| Name | Type |
|---|---|
| hexColor | string |
setARHeaderHorizontalTextMargin #
setARHeaderHorizontalTextMargin(value): void
Parameters:
| Name | Type |
|---|---|
| value | number |
setARHeaderVerticalTextMargin #
setARHeaderVerticalTextMargin(value): void
Parameters:
| Name | Type |
|---|---|
| value | number |
setARHeaderTextFormat #
setARHeaderTextFormat(value): void
Parameters:
| Name | Type |
|---|---|
| value | string |
getBarkoderARMode #
getBarkoderARMode()
Retrieves the current AR mode used for barcode scanning.
getARLocationTransitionSpeed #
getARLocationTransitionSpeed()
Retrieves the transition speed for AR barcode location overlays.
getAROverlayRefresh #
getAROverlayRefresh()
Retrieves the AR overlay refresh mode.
getARSelectedLocationColor #
getARSelectedLocationColor()
Retrieves the color used for selected barcode overlays in AR mode.
getARNonSelectedLocationColor #
getARNonSelectedLocationColor()
Retrieves the color used for non-selected barcode overlays in AR mode.
getARSelectedLocationLineWidth #
getARSelectedLocationLineWidth()
Retrieves the line width for selected barcode overlays in AR mode.
getARNonSelectedLocationLineWidth #
getARNonSelectedLocationLineWidth()
Retrieves the line width for non-selected barcode overlays in AR mode.
getARLocationType #
getARLocationType()
Retrieves the style of AR location overlays (tight, bounding box, none).
getARResultLimit #
getARResultLimit()
Retrieves the maximum number of results allowed in a single AR scanning session.
getARContinueScanningOnLimit #
getARContinueScanningOnLimit()
Retrieves whether scanning continues when the result limit is reached (only in .interactiveDisabled mode).
getAREmitResultsAtSessionEndOnly #
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:
getARReturnOnlyMatchedResults(): any
getARDisplayOnlyMatchedResults #
Retrieves whether only matched results are displayed in AR match filter mode.
Syntax:
getARDisplayOnlyMatchedResults(): any
getARHeaderHeight #
getARHeaderHeight()
Retrieves the header height above barcode in AR mode.
getBarkoderARHeaderShowMode #
getBarkoderARHeaderShowMode()
Retrieves the header display mode (always, on selected, never).
getARHeaderMaxTextHeight #
getARHeaderMaxTextHeight()
Retrieves the maximum text height for AR headers.
getARHeaderMinTextHeight #
getARHeaderMinTextHeight()
Retrieves the minimum text height for AR headers.
getARHeaderTextColorSelected #
getARHeaderTextColorSelected()
Retrieves the header text color for selected barcodes.
getARHeaderTextColorNonSelected #
getARHeaderTextColorNonSelected()
Retrieves the header text color for non-selected barcodes.
getARHeaderHorizontalTextMargin #
getARHeaderHorizontalTextMargin()
Retrieves the horizontal margin for AR header text.
getARHeaderVerticalTextMargin #
getARHeaderVerticalTextMargin()
Retrieves the vertical margin for AR header text.
getARHeaderTextFormat #
getARHeaderTextFormat()
Retrieves the format string used for AR header text.
isARDoubleTapToFreezeEnabled #
isARDoubleTapToFreezeEnabled()
Checks whether double-tap to freeze is enabled in AR mode.
isARImageResultEnabled #
isARImageResultEnabled()
Retrieves whether image result is enabled for AR mode.
isARBarcodeThumbnailOnResultEnabled #
isARBarcodeThumbnailOnResultEnabled()
Retrieves whether barcode thumbnail on result is enabled for AR mode.
BarkoderARMode #
The AR mode setBarkoderARMode takes.
export enum BarkoderARMode {
OFF = 0,
InteractiveDisabled = 1,
InteractiveEnabled = 2,
NonInteractive = 3,
MatchFilter = 4
}
BarkoderAROverlayRefresh #
How AR overlays refresh.
export enum BarkoderAROverlayRefresh {
SMOOTH = 0,
NORMAL = 1
}
BarkoderARLocationType #
The style of AR location overlays.
export enum BarkoderARLocationType {
NONE = 0,
TIGHT = 1,
BOUNDINGBOX = 2
}
BarkoderARHeaderShowMode #
When AR headers show.
export enum BarkoderARHeaderShowMode {
NEVER = 0,
ALWAYS = 1,
ONSELECTED = 2
}