On this page

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

API reference

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

Scanning & session #

getDecodingSpeed #

TypeScript
â–¸ getDecodingSpeed(): Promise<DecodingSpeed>

Retrieves the current decoding speed setting for barcode scanning.

getMatchFilter #

TypeScript
getMatchFilter(): Promise

Retrieves the string or regular expression used to match decoded barcode data.

getThreadsLimit #

TypeScript
â–¸ getThreadsLimit(): Promise<number>

Retrieves the threads limit.

getVersion #

TypeScript
â–¸ getVersion(): Promise<string>

Retrieves the version of the Barkoder SDK.

getLibVersion #

TypeScript
â–¸ getLibVersion(): Promise<string>

Retrieves the version of the Barkoder library.

getDeviceId #

TypeScript
getDeviceId(): Promise

Retrieves the Device ID.

onDataReturned #

TypeScript
onDataReturned(event): void

Parameters:

NameType
eventany

Android bridge handler used by BarkoderView. Applications should receive decoded results through the callback supplied to startScanning or scanImage, rather than call this handler directly.

pauseScanning #

TypeScript
pauseScanning(): void

Temporarily suspends the barcode scanning process, pausing the camera feed without completely stopping the scanning session.

setDecodingSpeed #

TypeScript
setDecodingSpeed(decodingSpeed): void

Sets the decoding speed for barcode scanning.

setMatchFilter #

TypeScript
setMatchFilter(value): void

Sets a string or regular expression used to match decoded barcode data.

Parameters:

NameType
valuestring

setThreadsLimit #

TypeScript
â–¸ setThreadsLimit(threadsLimit): Promise<boolean>

Sets the threads limit.

Parameters:

NameType
threadsLimitnumber

startScanning #

TypeScript
startScanning(resultsCallback): void

Initiates the barcode scanning process, allowing the application to detect and decode barcodes from the device's camera feed.

Parameters:

NameType
resultsCallback(result: Barkoder.BarkoderResult) => void

stopScanning #

TypeScript
stopScanning(): void

Halts the barcode scanning process, stopping the camera from capturing and processing barcode information

freezeScanning #

TypeScript
freezeScanning(): void

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.

getPowerSavingMode #

TypeScript
getPowerSavingMode(): Promise

Retrieves the power saving mode level.

selectVisibleBarcodes #

TypeScript
selectVisibleBarcodes(): void

Selects all barcodes that are currently visible in AR mode.

setDynamicExposure #

TypeScript
setDynamicExposure(intensity): void

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

Parameters:

NameType
intensitynumber

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

unfreezeScanning #

TypeScript
unfreezeScanning(): void

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.

configureBarkoder #

TypeScript
configureBarkoder(barkoderConfig: Barkoder.BarkoderConfig): Promise<boolean>

Configures the Barkoder functionality based on the provided configuration.

Parameters:

NameType
barkoderConfigBarkoder.BarkoderConfig

Pass a Barkoder.BarkoderConfig instance. The wrapper calls its toJsonString() method before sending the configuration to the native view. Obtain the scanner through BarkoderView's onBarkoderViewCreated callback before configuring it.

Returns: A promise resolving to true on successful configuration. Configuration errors reject the promise; serialization errors may throw synchronously.

Camera #

getBarkoderResolution #

TypeScript
â–¸ getBarkoderResolution(): Promise<BarkoderResolution>

Retrieves the resolution for barcode scanning.

getMaxZoomFactor #

TypeScript
â–¸ getMaxZoomFactor(): Promise<number>

Retrieves the maximum available zoom factor for the device's camera.

isFlashAvailable #

TypeScript
â–¸ isFlashAvailable(): Promise<boolean>

Checks whether the device has a flash (torch) available for illumination during barcode scanning.

isLocationInPreviewEnabled #

TypeScript
â–¸ isLocationInPreviewEnabled(): Promise<boolean>

Checks whether barcode location information is displayed on the camera preview.

isPinchToZoomEnabled #

TypeScript
â–¸ isPinchToZoomEnabled(): Promise<boolean>

Checks whether pinch-to-zoom is enabled.

isPreviewMirrored #

TypeScript
â–¸ isPreviewMirrored(): Promise<boolean>

Retrieves whether the front camera preview is horizontally mirrored.

setBarkoderResolution #

TypeScript
setBarkoderResolution(barkoderResolution): void

Sets the resolution for barcode scanning.

setFlashEnabled #

TypeScript
setFlashEnabled(enabled): void

Enables or disables the device's flash (torch) for illumination during barcode scanning

setLocationInPreviewEnabled #

TypeScript
setLocationInPreviewEnabled(enabled): void

Enables or disables the display of barcode location information on the camera preview.

setPinchToZoomEnabled #

TypeScript
setPinchToZoomEnabled(enabled): void

Enables or disables the pinch-to-zoom feature for adjusting the zoom level during barcode scanning.

setZoomFactor #

TypeScript
setZoomFactor(zoomFactor): void

Sets the zoom factor for the device's camera, adjusting the level of zoom during barcode scanning.

Parameters:

NameType
zoomFactornumber

startCamera #

TypeScript
startCamera(): void

Starts the camera for barcode scanning.

getCurrentZoomFactor #

TypeScript
getCurrentZoomFactor(): Promise

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

setCentricFocusAndExposure #

TypeScript
setCentricFocusAndExposure(value): void

Sets the camera to use the center of the viewfinder for focus and exposure.

Parameters:

NameType
valueboolean

setCamera #

TypeScript
setCamera(value): Promise<boolean>

Sets the camera used for scanning: back or front.

Parameters:

NameType
valuenumber

setPreviewMirrored #

TypeScript
setPreviewMirrored(value): void

Controls whether the front camera preview is horizontally mirrored.

Parameters:

NameType
valueboolean

Barcode types #

getBarcodeTypeLengthRange #

TypeScript
▸ getBarcodeTypeLengthRange(barcodeType): Promise<number[]>

Retrieves the length range of the specified barcode type.

Parameters:

NameType
barcodeTypeBarcodeType

getCode11ChecksumType #

TypeScript
â–¸ getCode11ChecksumType(): Promise<Code11ChecksumType>

Retrieves the checksum type for Code 11 barcodes.

getCode39ChecksumType #

TypeScript
â–¸ getCode39ChecksumType(): Promise<Code39ChecksumType>

Retrieves the checksum type for Code 39 barcodes.

getEncodingCharacterSet #

TypeScript
â–¸ getEncodingCharacterSet(): Promise<string>

Retrieves the character set used for encoding barcode data.

getFormattingType #

TypeScript
getFormattingType(): Promise<FormattingType>

Retrieves the formatting type used for presenting decoded barcode data.

getMsiChecksumType #

TypeScript
â–¸ getMsiChecksumType(): Promise<MsiChecksumType>

Retrieves the MSI checksum type.

isBarcodeTypeEnabled #

TypeScript
â–¸ isBarcodeTypeEnabled(barcodeType): Promise<boolean>

Checks whether the specified barcode type is enabled.

Parameters:

NameType
barcodeTypeBarcodeType

isMisshaped1DEnabled #

TypeScript
â–¸ isMisshaped1DEnabled(): Promise<boolean>

Checks whether detection of misshaped 1D barcodes is enabled.

isUpcEanDeblurEnabled #

TypeScript
â–¸ isUpcEanDeblurEnabled(): Promise<boolean>

Checks whether deblurring is enabled for UPC/EAN barcodes.

isVINRestrictionsEnabled #

TypeScript
â–¸ isVINRestrictionsEnabled(): Promise<boolean>

Checks whether Vehicle Identification Number (VIN) restrictions are enabled.

setBarcodeTypeEnabled #

TypeScript
setBarcodeTypeEnabled(barcodeType, enabled): void

Enables or disables the specified barcode type for scanning.

Parameters:

NameType
barcodeTypeBarcodeType
enabledboolean

setBarcodeTypeLengthRange #

TypeScript
â–¸ setBarcodeTypeLengthRange(barcodeType, min, max): Promise<boolean>

Sets the length range for the specified barcode type.

Parameters:

NameType
barcodeTypeBarcodeType
minnumber
maxnumber

setCode11ChecksumType #

TypeScript
setCode11ChecksumType(code11ChecksumType): void

Sets the checksum type for Code 11 barcodes.

Parameters:

NameType
code11ChecksumTypeCode11ChecksumType

setCode39ChecksumType #

TypeScript
setCode39ChecksumType(code39ChecksumType): void

Sets the checksum type for Code 39 barcodes.

Parameters:

NameType
code39ChecksumTypeCode39ChecksumType

setDatamatrixDpmModeEnabled #

TypeScript
setDatamatrixDpmModeEnabled(enabled): void

Enables or disables Direct Part Marking (DPM) mode for Datamatrix barcodes.

Parameters:

NameType
enabledboolean

setEnableMisshaped1DEnabled #

TypeScript
setEnableMisshaped1DEnabled(enabled): void

Enables or disables detection of misshaped 1D barcodes.

Parameters:

NameType
enabledboolean

setEnableVINRestrictions #

TypeScript
setEnableVINRestrictions(enabled): void

Enables or disables Vehicle Identification Number (VIN) restrictions.

Parameters:

NameType
enabledboolean

setEncodingCharacterSet #

TypeScript
setEncodingCharacterSet(encodingCharacterSet): void

Sets the encoding character set for barcode scanning

setFormattingType #

TypeScript
setFormattingType(formatting): void

Sets the formatting type for decoded barcode data.

Parameters:

NameType
formattingFormattingType

setMsiChecksumType #

TypeScript
setMsiChecksumType(msiChecksumType): void

Sets the MSI checksum type.

Parameters:

NameType
msiChecksumTypeMsiChecksumType

setUpcEanDeblurEnabled #

TypeScript
setUpcEanDeblurEnabled(enabled): void

Enables or disables deblurring for UPC/EAN barcodes.

Parameters:

NameType
enabledboolean

isIdDocumentMasterChecksumEnabled #

TypeScript
isIdDocumentMasterChecksumEnabled(): Promise

Retrieves whether Master checksum is enabled when scanning ID Documents.

isQrDpmModeEnabled #

TypeScript
isQrDpmModeEnabled(): Promise

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

isQrMicroDpmModeEnabled #

TypeScript
isQrMicroDpmModeEnabled(): Promise

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

isQrMultiPartMergeEnabled #

TypeScript
isQrMultiPartMergeEnabled(): Promise

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

setCustomOption #

TypeScript
setCustomOption(string, int): void

Setting custom option.

See more details about available options and their values.

Parameters:

NameType
stringString
intnumber

setEnableComposite #

TypeScript
setEnableComposite(value): void

Sets whether Composite Mode is enabled for scanning.

Parameters:

NameType
valuenumber

setIdDocumentMasterChecksumEnabled #

TypeScript
setIdDocumentMasterChecksumEnabled(enabled): void

Sets whether the master checksum is required when scanning ID documents.

Parameters:

NameType
enabledboolean

setQrDpmModeEnabled #

TypeScript
setQrDpmModeEnabled(enabled): void

Enables or disables Direct Part Marking (DPM) mode for QR barcodes.

Parameters:

NameType
enabledboolean

setQrMicroDpmModeEnabled #

TypeScript
setQrMicroDpmModeEnabled(enabled): void

Enables or disables Direct Part Marking (DPM) mode for QR Micro barcodes.

Parameters:

NameType
enabledboolean

setQrMultiPartMergeEnabled #

TypeScript
setQrMultiPartMergeEnabled(enabled): void

Enables or disables QR multi-part merge mode.

Parameters:

NameType
enabledboolean

isDatamatrixDpmModeEnabled #

TypeScript
isDatamatrixDpmModeEnabled(): Promise<boolean>

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

Returns: A promise resolving to whether Datamatrix DPM mode is enabled.

Results #

getReturnOnlyMatchedResults #

TypeScript
â–¸ getReturnOnlyMatchedResults(): Promise<boolean>

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

getMaximumResultsCount #

TypeScript
â–¸ getMaximumResultsCount(): Promise<number>

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

getMulticodeCachingDuration #

TypeScript
â–¸ getMulticodeCachingDuration(): Promise<number>

Retrieves the caching duration, in milliseconds, for multi-code results.

getMulticodeCachingEnabled #

TypeScript
â–¸ getMulticodeCachingEnabled(): Promise<boolean>

Retrieves whether multi-code caching is enabled.

getThresholdBetweenDuplicatesScans #

TypeScript
â–¸ getThresholdBetweenDuplicatesScans(): Promise<number>

Retrieves the threshold between duplicate scans.

isBarcodeThumbnailOnResultEnabled #

TypeScript
â–¸ isBarcodeThumbnailOnResultEnabled(): Promise<boolean>

Checks whether barcode thumbnails are enabled in scanning results.

isBeepOnSuccessEnabled #

TypeScript
â–¸ isBeepOnSuccessEnabled(): Promise<boolean>

Checks whether an audible beep is enabled on successful barcode scanning.

isCloseSessionOnResultEnabled #

TypeScript
â–¸ isCloseSessionOnResultEnabled(): Promise<boolean>

Checks whether the scanning session closes automatically when a barcode result is detected.

isImageResultEnabled #

TypeScript
â–¸ isImageResultEnabled(): Promise<boolean>

Checks whether image data is enabled in scanning results.

isVibrateOnSuccessEnabled #

TypeScript
â–¸ isVibrateOnSuccessEnabled(): Promise<boolean>

Checks whether vibration is enabled on successful barcode scanning.

setBarcodeThumbnailOnResultEnabled #

TypeScript
setBarcodeThumbnailOnResultEnabled(enabled): void

Enables or disables barcode thumbnails in scanning results.

Parameters:

NameType
enabledboolean

setBeepOnSuccessEnabled #

TypeScript
setBeepOnSuccessEnabled(enabled): void

Enables or disables the audible beep sound upon successfully decoding a barcode.

Parameters:

NameType
enabledboolean

setCloseSessionOnResultEnabled #

TypeScript
setCloseSessionOnResultEnabled(enabled): void

Enables or disables the automatic closing of the scanning session upon detecting a barcode result.

Parameters:

NameType
enabledboolean

setReturnOnlyMatchedResults #

TypeScript
setReturnOnlyMatchedResults(value): void

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

If false, all decoded results are returned, including unmatched results.

This option only applies when a match filter is active.

Parameters:

NameType
valueboolean

setImageResultEnabled #

TypeScript
setImageResultEnabled(enabled): void

Enables or disables the capturing and processing of image data when a barcode is successfully detected.

setMaximumResultsCount #

TypeScript
setMaximumResultsCount(maximumResultsCount): void

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

Parameters:

NameType
maximumResultsCountnumber

setMulticodeCachingDuration #

TypeScript
setMulticodeCachingDuration(multicodeCachingDuration): any

Sets the caching duration, in milliseconds, for multi-code results.

Parameters:

NameType
multicodeCachingDurationnumber

setMulticodeCachingEnabled #

TypeScript
setMulticodeCachingEnabled(multicodeCachingEnabled): any

Enables or disables multi-code caching.

Parameters:

NameType
multicodeCachingEnabledboolean

setThresholdBetweenDuplicatesScans #

TypeScript
setThresholdBetweenDuplicatesScans(thresholdBetweenDuplicatesScans): void

Sets the threshold between duplicate scans.

Parameters:

NameType
thresholdBetweenDuplicatesScansnumber

setVibrateOnSuccessEnabled #

TypeScript
setVibrateOnSuccessEnabled(enabled): void

Enables or disables the device vibration upon successfully decoding a barcode.

Parameters:

NameType
enabledboolean

captureImage #

TypeScript
captureImage(): void

Captures the latest camera frame.

getShowDuplicatesLocations #

TypeScript
getShowDuplicatesLocations(): Promise

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

scanImage #

TypeScript
scanImage(base64, resultsCallback): void

Scan barcodes from base64 string image.

Parameters:

NameType
base64String
resultsCallback(result: Barkoder.BarkoderResult) => void

setShowDuplicatesLocations #

TypeScript
setShowDuplicatesLocations(value): void

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

Parameters:

NameType
valueboolean

Region & overlay #

getLocationLineColorHex #

TypeScript
â–¸ getLocationLineColorHex(): Promise<string>

Retrieves the hexadecimal color code of the lines indicating detected barcode locations.

getLocationLineWidth #

TypeScript
â–¸ getLocationLineWidth(): Promise<number>

Retrieves the width of the lines indicating detected barcode locations on the camera preview.

getRegionOfInterest #

TypeScript
â–¸ getRegionOfInterest(): Promise<number[]>

Retrieves the Region of Interest (ROI).

getRoiLineColorHex #

TypeScript
â–¸ getRoiLineColorHex(): Promise<string>

Retrieves the hexadecimal color code of the lines outlining the Region of Interest (ROI).

getRoiLineWidth #

TypeScript
â–¸ getRoiLineWidth(): Promise<number>

Retrieves the width of the lines outlining the Region of Interest (ROI).

getRoiOverlayBackgroundColorHex #

TypeScript
â–¸ getRoiOverlayBackgroundColorHex(): Promise<string>

Retrieves the hexadecimal background color of the Region of Interest (ROI) overlay.

isLocationInImageResultEnabled #

TypeScript
â–¸ isLocationInImageResultEnabled(): Promise<boolean>

Checks whether barcode location information is included in the image result.

isRegionOfInterestVisible #

TypeScript
â–¸ isRegionOfInterestVisible(): Promise<boolean>

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

getRoiCenterMark #

TypeScript
getRoiCenterMark(): Promise

Retrieves the visual marker displayed at the center of the Region of Interest (ROI).

setLocationInImageResultEnabled #

TypeScript
setLocationInImageResultEnabled(enabled): void

Enables or disables the inclusion of barcode location information within the image data result

setLocationLineColor #

TypeScript
**setLocationLineColor**(hexColor): Promise<boolean>

Sets the color of the lines used to indicate the location of detected barcodes on the camera feed.

Parameters:

NameType
hexColorString

setLocationLineWidth #

TypeScript
setLocationLineWidth(lineWidth): void

Sets the width of the lines indicating the location of detected barcodes on the camera feed.

Parameters:

NameType
lineWidthnumber

setRegionOfInterest #

TypeScript
**setRegionOfInterest**(left, top, width, height): Promise<boolean>

Defines the Region of Interest (ROI) on the camera preview for barcode scanning, specifying an area where the application focuses on detecting barcodes.

Parameters:

NameType
leftnumber
topnumber
widthnumber
heightnumber

setRegionOfInterestVisible #

TypeScript
setRegionOfInterestVisible(visible): void

Sets the visibility of the Region of Interest (ROI) on the camera preview.

Parameters:

NameType
visibleboolean

setRoiCenterMark #

TypeScript
setRoiCenterMark(value): void

Sets the visual marker displayed at the center of the Region of Interest (ROI).

Parameters:

NameType
valueBarkoderRoiCenterMark

setRoiLineColor #

TypeScript
**setRoiLineColor**(hexColor): Promise<boolean>

Sets the color of the lines outlining the Region of Interest (ROI) for barcode scanning on the camera feed.

Parameters:

NameType
hexColorString

setRoiLineWidth #

TypeScript
setRoiLineWidth(lineWidth): void

Sets the width of the lines outlining the Region of Interest (ROI) for barcode scanning on the camera feed

Parameters:

NameType
lineWidthnumber

setRoiOverlayBackgroundColor #

TypeScript
**setRoiOverlayBackgroundColor**(hexColor): Promise<boolean>

Sets the background color of the overlay within the Region of Interest (ROI) for barcode scanning on the camera feed.

Parameters:

NameType
hexColorString

getScanningIndicatorColorHex #

TypeScript
getScanningIndicatorColorHex(): Promise

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

getScanningIndicatorWidth #

TypeScript
getScanningIndicatorWidth(): Promise

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

getScanningIndicatorAnimation #

TypeScript
getScanningIndicatorAnimation(): Promise

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

isScanningIndicatorAlwaysVisible #

TypeScript
isScanningIndicatorAlwaysVisible(): Promise

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

setScanningIndicatorAlwaysVisible #

TypeScript
setScanningIndicatorAlwaysVisible(value): void

Sets whether the scanning indicator is always visible on the camera preview.

Parameters:

NameType
valueboolean

setScanningIndicatorColor #

TypeScript
setScanningIndicatorColor(hexColor): Promise<boolean>

Sets the scanning indicator color on the camera preview.

Parameters:

NameType
hexColorString

setScanningIndicatorWidth #

TypeScript
setScanningIndicatorWidth(lineWidth): void

Sets the scanning indicator width on the camera preview.

Parameters:

NameType
lineWidthnumber

setScanningIndicatorAnimation #

TypeScript
setScanningIndicatorAnimation(animation): void

Sets the scanning indicator animation on the camera preview.

Parameters:

NameType
animationnumber

AR mode #

getARMode #

TypeScript
getARMode(): Promise

Retrieves the current AR mode used for barcode scanning.

getARReturnOnlyMatchedResults #

TypeScript
getARReturnOnlyMatchedResults(): Promise

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

getARDisplayOnlyMatchedResults #

TypeScript
getARDisplayOnlyMatchedResults(): Promise

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

getARResultDisappearanceDelayMs #

TypeScript
getARResultDisappearanceDelayMs(): Promise

Retrieves the delay after which AR results disappear once detected.

getARLocationTransitionSpeed #

TypeScript
getARLocationTransitionSpeed(): Promise

Retrieves the transition speed for AR barcode location overlays.

getAROverlayRefresh #

TypeScript
â–¸ getAROverlayRefresh(): Promise<BarkoderAROverlayRefresh>

Retrieves the AR overlay refresh mode.

getARSelectedLocationColor #

TypeScript
getARSelectedLocationColor(): Promise

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

getARNonSelectedLocationColor #

TypeScript
getARNonSelectedLocationColor(): Promise

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

getARSelectedLocationLineWidth #

TypeScript
getARSelectedLocationLineWidth(): Promise

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

getARNonSelectedLocationLineWidth #

TypeScript
getARNonSelectedLocationLineWidth(): Promise

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

getARLocationType #

TypeScript
â–¸ getARLocationType(): Promise<BarkoderARLocationType>

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

getARResultLimit #

TypeScript
getARResultLimit(): Promise

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

getARContinueScanningOnLimit #

TypeScript
getARContinueScanningOnLimit(): Promise

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

getAREmitResultsAtSessionEndOnly #

TypeScript
getAREmitResultsAtSessionEndOnly(): Promise

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

getARHeaderHeight #

TypeScript
getARHeaderHeight(): Promise

Retrieves the header height above barcode in AR mode.

getARHeaderShowMode #

TypeScript
â–¸ getARHeaderShowMode(): Promise<BarkoderARHeaderShowMode>

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

getARHeaderMaxTextHeight #

TypeScript
getARHeaderMaxTextHeight(): Promise

Retrieves the maximum text height for AR headers.

getARHeaderMinTextHeight #

TypeScript
getARHeaderMinTextHeight(): Promise

Retrieves the minimum text height for AR headers.

getARHeaderTextColorSelected #

TypeScript
getARHeaderTextColorSelected(): Promise

Retrieves the header text color for selected barcodes.

getARHeaderTextColorNonSelected #

TypeScript
getARHeaderTextColorNonSelected(): Promise

Retrieves the header text color for non-selected barcodes.

getARHeaderHorizontalTextMargin #

TypeScript
getARHeaderHorizontalTextMargin(): Promise

Retrieves the horizontal margin for AR header text.

getARHeaderVerticalTextMargin #

TypeScript
getARHeaderVerticalTextMargin(): Promise

Retrieves the vertical margin for AR header text.

getARHeaderTextFormat #

TypeScript
getARHeaderTextFormat(): Promise

Retrieves the format string used for AR header text.

isARDoubleTapToFreezeEnabled #

TypeScript
isARDoubleTapToFreezeEnabled(): Promise

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

isARImageResultEnabled #

TypeScript
isARImageResultEnabled(): Promise

Retrieves whether image result is enabled for AR mode.

isARBarcodeThumbnailOnResultEnabled #

TypeScript
isARBarcodeThumbnailOnResultEnabled(): Promise

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

resetARCache #

TypeScript
resetARCache(): void

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

setARMode #

TypeScript
setARMode(value): void

Sets the AR mode used for barcode scanning visualization.

Parameters:

NameType
valueBarkoderARMode

setARReturnOnlyMatchedResults #

TypeScript
setARReturnOnlyMatchedResults(value): void

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:

NameType
valueboolean

setARDisplayOnlyMatchedResults #

TypeScript
setARDisplayOnlyMatchedResults(value): void

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:

NameType
valueboolean

setARResultDisappearanceDelayMs #

TypeScript
setARResultDisappearanceDelayMs(value): void

Sets the delay, in milliseconds, after which a detected AR result is removed.

Parameters:

NameType
valuenumber

setARLocationTransitionSpeed #

TypeScript
setARLocationTransitionSpeed(value): void

Sets the transition speed of barcode location overlays in AR mode.

Parameters:

NameType
valuenumber

setAROverlayRefresh #

TypeScript
setAROverlayRefresh(value): void

Sets the AR overlay refresh mode.

Parameters:

NameType
valueBarkoderAROverlayRefresh

setARSelectedLocationColor #

TypeScript
setARSelectedLocationColor(hexColor): Promise<boolean>

Sets the color of selected barcode location overlays in AR mode.

Parameters:

NameType
hexColorstring

setARNonSelectedLocationColor #

TypeScript
setARNonSelectedLocationColor(hexColor): Promise<boolean>

Sets the color of non-selected barcode location overlays in AR mode.

Parameters:

NameType
hexColorstring

setARSelectedLocationLineWidth #

TypeScript
setARSelectedLocationLineWidth(value): void

Sets the line width of selected barcode location overlays in AR mode.

Parameters:

NameType
valuenumber

setARNonSelectedLocationLineWidth #

TypeScript
setARNonSelectedLocationLineWidth(value): void

Sets the line width of non-selected barcode location overlays in AR mode.

Parameters:

NameType
valuenumber

setARLocationType #

TypeScript
setARLocationType(value): void

Sets the style of barcode location overlays in AR mode: tight, bounding box, or none.

Parameters:

NameType
valueBarkoderARLocationType

setARDoubleTapToFreezeEnabled #

TypeScript
setARDoubleTapToFreezeEnabled(enabled): void

Enables or disables double-tap to freeze in AR mode.

Parameters:

NameType
enabledboolean

setARImageResultEnabled #

TypeScript
setARImageResultEnabled(enabled): void

Enables or disables capturing image data when a barcode is selected in AR mode.

Parameters:

NameType
enabledboolean

setARBarcodeThumbnailOnResultEnabled #

TypeScript
setARBarcodeThumbnailOnResultEnabled(enabled): void

Enables or disables barcode thumbnails in AR scanning results.

Parameters:

NameType
enabledboolean

setARResultLimit #

TypeScript
setARResultLimit(value): void

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

Parameters:

NameType
valuenumber

setARContinueScanningOnLimit #

TypeScript
setARContinueScanningOnLimit(value): void

Sets whether scanning continues when the result limit is reached in interactiveDisabled AR mode.

Parameters:

NameType
valueboolean

setAREmitResultsAtSessionEndOnly #

TypeScript
setAREmitResultsAtSessionEndOnly(value): void

Sets whether results are emitted only at the end of an AR session or when the result limit is reached.

Parameters:

NameType
valueboolean

setARHeaderHeight #

TypeScript
setARHeaderHeight(value): void

Sets the height of the header label shown above barcodes in AR mode.

Parameters:

NameType
valuenumber

setARHeaderShowMode #

TypeScript
setARHeaderShowMode(value): void

Sets when the AR header is displayed: always, on selected barcodes, or never.

Parameters:

NameType
valueBarkoderARHeaderShowMode

setARHeaderMaxTextHeight #

TypeScript
setARHeaderMaxTextHeight(value): void

Sets the maximum height of AR header text.

Parameters:

NameType
valuenumber

setARHeaderMinTextHeight #

TypeScript
setARHeaderMinTextHeight(value): void

Sets the minimum height of AR header text.

Parameters:

NameType
valuenumber

setARHeaderTextColorSelected #

TypeScript
setARHeaderTextColorSelected(hexColor): Promise<boolean>

Sets the header text color for selected barcodes in AR mode.

Parameters:

NameType
hexColorstring

setARHeaderTextColorNonSelected #

TypeScript
setARHeaderTextColorNonSelected(hexColor): Promise<boolean>

Sets the header text color for non-selected barcodes in AR mode.

Parameters:

NameType
hexColorstring

setARHeaderHorizontalTextMargin #

TypeScript
setARHeaderHorizontalTextMargin(value): void

Sets the horizontal margin on both sides of AR header text.

Parameters:

NameType
valuenumber

setARHeaderVerticalTextMargin #

TypeScript
setARHeaderVerticalTextMargin(value): void

Sets the vertical margin above and below AR header text.

Parameters:

NameType
valuenumber

setARHeaderTextFormat #

TypeScript
setARHeaderTextFormat(value): void

Sets the format string used for AR header text.

Parameters:

NameType
valuestring

On-screen buttons #

configureCloseButton #

TypeScript
configureCloseButton(visible, positionX, positionY, iconSize, tintColor, backgroundColor, cornerRadius, padding, useCustomIcon, customIcon): void

Configures the close button shown during scanning. To perform an action when the button is tapped, register a callback using onCloseButtonTapped

Parameters:

NameType
visibleboolean
positionXnumber
positionYnumber
iconSizenumber
tintColorstring
backgroundColorstring
cornerRadiusnumber
paddingnumber
useCustomIconboolean
customIconstring

configureFlashButton #

TypeScript
configureFlashButton(visible, positionX, positionY, iconSize, tintColor, backgroundColor, cornerRadius, padding, useCustomIcon, customIconFlashOn, customIconFlashOff): void

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

Parameters:

NameType
visibleboolean
positionXnumber
positionYnumber
iconSizenumber
tintColorstring
backgroundColorstring
cornerRadiusnumber
paddingnumber
useCustomIconboolean
customIconFlashOnstring
customIconFlashOffstring

configureZoomButton #

TypeScript
configureZoomButton(visible, positionX, positionY, iconSize, tintColor, backgroundColor, cornerRadius, padding, useCustomIcon, customIconZoomedIn, customIconZoomedOut, zoomedInFactor, zoomedOutFactor): void

Configures the zoom button shown during scanning.

Parameters:

NameType
visibleboolean
positionXnumber
positionYnumber
iconSizenumber
tintColorstring
backgroundColorstring
cornerRadiusnumber
paddingnumber
useCustomIconboolean
customIconZoomedInstring
customIconZoomedOutstring
zoomedInFactornumber
zoomedOutFactornumber

onCloseButtonTapped #

TypeScript
onCloseButtonTapped(callback): void

Registers a callback for the SDK Close button during scanning. This is triggered when the user taps the Close button configured via configureCloseButton

Parameters:

NameType
callback() => void

Result models #

startScanning(resultsCallback) and scanImage(base64, resultsCallback) deliver a Barkoder.BarkoderResult to resultsCallback. Its callback type is (result: Barkoder.BarkoderResult) => void; ResultCallback is not a separately exported type. Neither method returns the decoded result synchronously or as a promise.

The tables below describe wrapper/model values, not raw native event payloads. A ? after a property name means that the property is optional in the TypeScript declaration. The description states the value assigned by the model constructor when native data is missing. null and undefined are distinct values.

Barkoder.BarkoderResult #

PropertyTypeDescription
decoderResultsBarkoder.DecoderResult[]Native decoder results converted into Barkoder.DecoderResult instances. Set to [] if the input is not an array.
resultThumbnailsAsBase64?string[] or nullJPEG data URLs beginning with data:image/jpeg;base64,, not plain Base64. Set to null if the native field is absent or is not an array. An array is converted item by item; falsy items are removed, so an empty array remains []. Do not assume an item exists at every decoder-result index.
resultImageAsBase64?string or nullFull result image as a JPEG data URL beginning with data:image/jpeg;base64,. Missing, null, or empty input becomes null.

The image and thumbnail fields depend on images supplied by the native SDK. Enable setImageResultEnabled(true) and setBarcodeThumbnailOnResultEnabled(true) for regular scanning, or the corresponding setARImageResultEnabled(true) and setARBarcodeThumbnailOnResultEnabled(true) settings for AR results. Enabling a setting does not make an image field unconditional.

Barkoder.DecoderResult #

PropertyTypeDescription
barcodeTypenumberNative barcode-type numeric value, copied without conversion. See Barkoder.BarcodeType.
barcodeTypeNamestringNative barcode-type name, copied without renaming.
binaryDataAsBase64stringBarcode binary data encoded as plain Base64. The wrapper does not add a data-URL prefix or decode the bytes.
textualDatastringNative decoded text, copied without conversion.
characterSet?string or nullNative character-set string. Missing, null, or empty input becomes null.
extra?Record<string, any> or nullThe native bridge serializes nonempty extra metadata as a JSON string; the wrapper applies JSON.parse and exposes the parsed value. If the native key is absent, this is null. Parsing is not caught by the constructor; malformed JSON throws. The declaration is a record, but the wrapper does not validate the parsed value's shape.
mrzImagesAsBase64?Array<{ name: string; base64: string }>Named MRZ images. Each base64 value is a JPEG data URL, despite the property's name. Missing or non-array input becomes []. See the named-image table below.
locationPoints?Array<{ x: number; y: number }>Location points copied from the native array; missing or non-array input becomes undefined, not null. An empty array remains []. See the point table below.
sadlImageAsBase64?string or nullSADL image extracted by the native helper from extra metadata when available. The wrapper converts it to a JPEG data URL; missing, null, or empty input becomes null.
isMatchedbooleanNative match-status value, copied without conversion or a wrapper fallback. Relevant to the match-filter settings.

Required scalar fields are copied as supplied; the wrapper does not validate their types or synthesize missing values.

Named MRZ Image #

Each entry in mrzImagesAsBase64 has the following properties.

PropertyTypeDescription
namestringNative image name. Both bridges include only main, document, signature, and picture. These are possible names, not a guarantee that any or all are returned.
base64stringImage content as a JPEG data URL beginning with data:image/jpeg;base64,.

Both bridges populate named MRZ images only when the native barcodeTypeName equals MRZ and native images are available. Other results receive [] from the wrapper. Image extraction and encoding can omit entries.

Location Point #

Each entry in locationPoints has the following properties.

PropertyTypeDescription
xnumberNative location point's x value, forwarded unchanged.
ynumberNative location point's y value, forwarded unchanged.

On iOS, the serializer reads four points when the native location pointer is present. On Android, it serializes the supplied native point array. The wrapper does not normalize coordinates, reorder points, or enforce a point count.

Enums #

The enums below are exported through the Barkoder namespace. For example, use Barkoder.BarcodeType.qr and Barkoder.BarkoderCameraPosition.FRONT. Member names are case-sensitive. Values are the plugin's numeric enum values, not default settings.

Barkoder.DecodingSpeed #

MemberValue
fast0
normal1
slow2
rigorous3

Barkoder.FormattingType #

MemberValue
disabled0
automatic1
gs12
aamva3
sadl4
bcbp5

Barkoder.MsiChecksumType #

MemberValue
disabled0
mod101
mod112
mod10103
mod11104
mod11IBM5
mod1110IBM6

Barkoder.Code39ChecksumType #

MemberValue
disabled0
enabled1

Barkoder.Code11ChecksumType #

MemberValue
disabled0
single1
double2

Barkoder.BarkoderCameraPosition #

MemberValue
BACK0
FRONT1

Barkoder.BarkoderResolution #

MemberValue
HD0
FHD1
UHD2

Barkoder.BarkoderRoiCenterMark #

MemberValue
none0
crosshair1
point2

Barkoder.BarkoderARMode #

MemberValue
off0
interactiveDisabled1
interactiveEnabled2
nonInteractive3
matchFilter4

Barkoder.BarkoderAROverlayRefresh #

MemberValue
smooth0
normal1

Barkoder.BarkoderARLocationType #

MemberValue
none0
tight1
boundingBox2

Barkoder.BarkoderARHeaderShowMode #

MemberValue
never0
always1
onSelected2

Barkoder.BarcodeType #

MemberValue
aztec0
aztecCompact1
qr2
qrMicro3
code1284
code935
code396
codabar7
code118
msi9
upcA10
upcE11
upcE112
ean1313
ean814
pdf41715
pdf417Micro16
datamatrix17
code2518
interleaved2519
itf1420
iata2521
matrix2522
datalogic2523
coop2524
code3225
telepen26
dotcode27
idDocument28
databar1429
databarLimited30
databarExpanded31
postalIMB32
postnet33
planet34
australianPost35
royalMail36
kix37
japanesePost38
maxiCode39
ocrText40

Barkoder.IdDocumentMasterChecksumType #

MemberValue
disabled0
enabled1

BarkoderView And Usage #

Import the named exports from barkoder-react-native. Render BarkoderView and obtain its scanner instance from onBarkoderViewCreated; do not construct a scanner with an application-created native-view reference.

Application Props #

PropertyTypeDescription
licenseKeystringLicense key passed to the native view to create its configuration.
styleViewStyleReact Native view style.
onBarkoderViewCreated(barkoder: Barkoder) => voidCalled after the plugin signals native configuration creation. Use the supplied instance for configuration and scanning. This callback does not itself certify license validity.

ViewStyle is a React Native type. Register the SDK close-button callback with barkoder.onCloseButtonTapped(callback) after initialization.