API reference
Every method, setting, enum and result of the barKoder React Native SDK, grouped by what you do with it.
Scanning & session #
getDecodingSpeed #
â–¸ getDecodingSpeed(): Promise<DecodingSpeed>
Retrieves the current decoding speed setting for barcode scanning.
getMatchFilter #
getMatchFilter(): Promise
Retrieves the string or regular expression used to match decoded barcode data.
getThreadsLimit #
â–¸ getThreadsLimit(): Promise<number>
Retrieves the threads limit.
getVersion #
â–¸ getVersion(): Promise<string>
Retrieves the version of the Barkoder SDK.
getLibVersion #
â–¸ getLibVersion(): Promise<string>
Retrieves the version of the Barkoder library.
getDeviceId #
getDeviceId(): Promise
Retrieves the Device ID.
onDataReturned #
onDataReturned(event): void
Parameters:
| Name | Type |
|---|---|
event | any |
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 #
pauseScanning(): void
Temporarily suspends the barcode scanning process, pausing the camera feed without completely stopping the scanning session.
setDecodingSpeed #
setDecodingSpeed(decodingSpeed): void
Sets the decoding speed for barcode scanning.
setMatchFilter #
setMatchFilter(value): void
Sets a string or regular expression used to match decoded barcode data.
Parameters:
| Name | Type |
|---|---|
value | string |
setThreadsLimit #
â–¸ setThreadsLimit(threadsLimit): Promise<boolean>
Sets the threads limit.
Parameters:
| Name | Type |
|---|---|
| threadsLimit | number |
startScanning #
startScanning(resultsCallback): void
Initiates the barcode scanning process, allowing the application to detect and decode barcodes from the device's camera feed.
Parameters:
| Name | Type |
|---|---|
| resultsCallback | (result: Barkoder.BarkoderResult) => void |
stopScanning #
stopScanning(): void
Halts the barcode scanning process, stopping the camera from capturing and processing barcode information
freezeScanning #
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 #
getPowerSavingMode(): Promise
Retrieves the power saving mode level.
selectVisibleBarcodes #
selectVisibleBarcodes(): void
Selects all barcodes that are currently visible in AR mode.
setDynamicExposure #
setDynamicExposure(intensity): void
Sets the camera's exposure dynamically based on the provided intensity, cycling through predefined compensation values.
Parameters:
| Name | Type |
|---|---|
| intensity | number |
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.
Default value is 0. 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 |
unfreezeScanning #
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 #
configureBarkoder(barkoderConfig: Barkoder.BarkoderConfig): Promise<boolean>
Configures the Barkoder functionality based on the provided configuration.
Parameters:
| Name | Type |
|---|---|
| barkoderConfig | Barkoder.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 #
â–¸ getBarkoderResolution(): Promise<BarkoderResolution>
Retrieves the resolution for barcode scanning.
getMaxZoomFactor #
â–¸ getMaxZoomFactor(): Promise<number>
Retrieves the maximum available zoom factor for the device's camera.
isFlashAvailable #
â–¸ isFlashAvailable(): Promise<boolean>
Checks whether the device has a flash (torch) available for illumination during barcode scanning.
isLocationInPreviewEnabled #
â–¸ isLocationInPreviewEnabled(): Promise<boolean>
Checks whether barcode location information is displayed on the camera preview.
isPinchToZoomEnabled #
â–¸ isPinchToZoomEnabled(): Promise<boolean>
Checks whether pinch-to-zoom is enabled.
isPreviewMirrored #
â–¸ isPreviewMirrored(): Promise<boolean>
Retrieves whether the front camera preview is horizontally mirrored.
setBarkoderResolution #
setBarkoderResolution(barkoderResolution): void
Sets the resolution for barcode scanning.
setFlashEnabled #
setFlashEnabled(enabled): void
Enables or disables the device's flash (torch) for illumination during barcode scanning
setLocationInPreviewEnabled #
setLocationInPreviewEnabled(enabled): void
Enables or disables the display of barcode location information on the camera preview.
setPinchToZoomEnabled #
setPinchToZoomEnabled(enabled): void
Enables or disables the pinch-to-zoom feature for adjusting the zoom level during barcode scanning.
setZoomFactor #
setZoomFactor(zoomFactor): void
Sets the zoom factor for the device's camera, adjusting the level of zoom during barcode scanning.
Parameters:
| Name | Type |
|---|---|
| zoomFactor | number |
startCamera #
startCamera(): void
Starts the camera for barcode scanning.
getCurrentZoomFactor #
getCurrentZoomFactor(): Promise
Retrieves the current zoom factor for the device's camera.
setCentricFocusAndExposure #
setCentricFocusAndExposure(value): void
Sets the camera to use the center of the viewfinder for focus and exposure.
Parameters:
| Name | Type |
|---|---|
| value | boolean |
setCamera #
setCamera(value): Promise<boolean>
Sets the camera used for scanning: back or front.
Parameters:
| Name | Type |
|---|---|
| value | number |
setPreviewMirrored #
setPreviewMirrored(value): void
Controls whether the front camera preview is horizontally mirrored.
Parameters:
| Name | Type |
|---|---|
| value | boolean |
Barcode types #
getBarcodeTypeLengthRange #
▸ getBarcodeTypeLengthRange(barcodeType): Promise<number[]>
Retrieves the length range of the specified barcode type.
Parameters:
| Name | Type |
|---|---|
barcodeType | BarcodeType |
getCode11ChecksumType #
â–¸ getCode11ChecksumType(): Promise<Code11ChecksumType>
Retrieves the checksum type for Code 11 barcodes.
getCode39ChecksumType #
â–¸ getCode39ChecksumType(): Promise<Code39ChecksumType>
Retrieves the checksum type for Code 39 barcodes.
getEncodingCharacterSet #
â–¸ getEncodingCharacterSet(): Promise<string>
Retrieves the character set used for encoding barcode data.
getFormattingType #
getFormattingType(): Promise<FormattingType>
Retrieves the formatting type used for presenting decoded barcode data.
getMsiChecksumType #
â–¸ getMsiChecksumType(): Promise<MsiChecksumType>
Retrieves the MSI checksum type.
isBarcodeTypeEnabled #
â–¸ isBarcodeTypeEnabled(barcodeType): Promise<boolean>
Checks whether the specified barcode type is enabled.
Parameters:
| Name | Type |
|---|---|
barcodeType | BarcodeType |
isMisshaped1DEnabled #
â–¸ isMisshaped1DEnabled(): Promise<boolean>
Checks whether detection of misshaped 1D barcodes is enabled.
isUpcEanDeblurEnabled #
â–¸ isUpcEanDeblurEnabled(): Promise<boolean>
Checks whether deblurring is enabled for UPC/EAN barcodes.
isVINRestrictionsEnabled #
â–¸ isVINRestrictionsEnabled(): Promise<boolean>
Checks whether Vehicle Identification Number (VIN) restrictions are enabled.
setBarcodeTypeEnabled #
setBarcodeTypeEnabled(barcodeType, enabled): void
Enables or disables the specified barcode type for scanning.
Parameters:
| Name | Type |
|---|---|
| barcodeType | BarcodeType |
| enabled | boolean |
setBarcodeTypeLengthRange #
â–¸ setBarcodeTypeLengthRange(barcodeType, min, max): Promise<boolean>
Sets the length range for the specified barcode type.
Parameters:
| Name | Type |
|---|---|
| barcodeType | BarcodeType |
| min | number |
| max | number |
setCode11ChecksumType #
setCode11ChecksumType(code11ChecksumType): void
Sets the checksum type for Code 11 barcodes.
Parameters:
| Name | Type |
|---|---|
| code11ChecksumType | Code11ChecksumType |
setCode39ChecksumType #
setCode39ChecksumType(code39ChecksumType): void
Sets the checksum type for Code 39 barcodes.
Parameters:
| Name | Type |
|---|---|
| code39ChecksumType | Code39ChecksumType |
setDatamatrixDpmModeEnabled #
setDatamatrixDpmModeEnabled(enabled): void
Enables or disables Direct Part Marking (DPM) mode for Datamatrix barcodes.
Parameters:
| Name | Type |
|---|---|
| enabled | boolean |
setEnableMisshaped1DEnabled #
setEnableMisshaped1DEnabled(enabled): void
Enables or disables detection of misshaped 1D barcodes.
Parameters:
| Name | Type |
|---|---|
| enabled | boolean |
setEnableVINRestrictions #
setEnableVINRestrictions(enabled): void
Enables or disables Vehicle Identification Number (VIN) restrictions.
Parameters:
| Name | Type |
|---|---|
| enabled | boolean |
setEncodingCharacterSet #
setEncodingCharacterSet(encodingCharacterSet): void
Sets the encoding character set for barcode scanning
setFormattingType #
setFormattingType(formatting): void
Sets the formatting type for decoded barcode data.
Parameters:
| Name | Type |
|---|---|
| formatting | FormattingType |
setMsiChecksumType #
setMsiChecksumType(msiChecksumType): void
Sets the MSI checksum type.
Parameters:
| Name | Type |
|---|---|
| msiChecksumType | MsiChecksumType |
setUpcEanDeblurEnabled #
setUpcEanDeblurEnabled(enabled): void
Enables or disables deblurring for UPC/EAN barcodes.
Parameters:
| Name | Type |
|---|---|
| enabled | boolean |
isIdDocumentMasterChecksumEnabled #
isIdDocumentMasterChecksumEnabled(): Promise
Retrieves whether Master checksum is enabled when scanning ID Documents.
isQrDpmModeEnabled #
isQrDpmModeEnabled(): Promise
Retrieves whether Direct Part Marking (DPM) mode for QR barcodes is enabled.
isQrMicroDpmModeEnabled #
isQrMicroDpmModeEnabled(): Promise
Retrieves whether Direct Part Marking (DPM) mode for QR Micro barcodes is enabled.
isQrMultiPartMergeEnabled #
isQrMultiPartMergeEnabled(): Promise
Retrieves whether the QR multi-part merge mode is enabled.
setCustomOption #
setCustomOption(string, int): void
Setting custom option.
See more details about available options and their values.
Parameters:
| Name | Type |
|---|---|
| string | String |
| int | number |
setEnableComposite #
setEnableComposite(value): void
Sets whether Composite Mode is enabled for scanning.
Parameters:
| Name | Type |
|---|---|
| value | number |
setIdDocumentMasterChecksumEnabled #
setIdDocumentMasterChecksumEnabled(enabled): void
Sets whether the master checksum is required when scanning ID documents.
Parameters:
| Name | Type |
|---|---|
| enabled | boolean |
setQrDpmModeEnabled #
setQrDpmModeEnabled(enabled): void
Enables or disables Direct Part Marking (DPM) mode for QR barcodes.
Parameters:
| Name | Type |
|---|---|
| enabled | boolean |
setQrMicroDpmModeEnabled #
setQrMicroDpmModeEnabled(enabled): void
Enables or disables Direct Part Marking (DPM) mode for QR Micro barcodes.
Parameters:
| Name | Type |
|---|---|
| enabled | boolean |
setQrMultiPartMergeEnabled #
setQrMultiPartMergeEnabled(enabled): void
Enables or disables QR multi-part merge mode.
Parameters:
| Name | Type |
|---|---|
| enabled | boolean |
isDatamatrixDpmModeEnabled #
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 #
â–¸ getReturnOnlyMatchedResults(): Promise<boolean>
Retrieves whether only results matching the configured match filter are returned.
getMaximumResultsCount #
â–¸ getMaximumResultsCount(): Promise<number>
Retrieves the maximum number of results to be returned from barcode scanning.
getMulticodeCachingDuration #
â–¸ getMulticodeCachingDuration(): Promise<number>
Retrieves the caching duration, in milliseconds, for multi-code results.
getMulticodeCachingEnabled #
â–¸ getMulticodeCachingEnabled(): Promise<boolean>
Retrieves whether multi-code caching is enabled.
getThresholdBetweenDuplicatesScans #
â–¸ getThresholdBetweenDuplicatesScans(): Promise<number>
Retrieves the threshold between duplicate scans.
isBarcodeThumbnailOnResultEnabled #
â–¸ isBarcodeThumbnailOnResultEnabled(): Promise<boolean>
Checks whether barcode thumbnails are enabled in scanning results.
isBeepOnSuccessEnabled #
â–¸ isBeepOnSuccessEnabled(): Promise<boolean>
Checks whether an audible beep is enabled on successful barcode scanning.
isCloseSessionOnResultEnabled #
â–¸ isCloseSessionOnResultEnabled(): Promise<boolean>
Checks whether the scanning session closes automatically when a barcode result is detected.
isImageResultEnabled #
â–¸ isImageResultEnabled(): Promise<boolean>
Checks whether image data is enabled in scanning results.
isVibrateOnSuccessEnabled #
â–¸ isVibrateOnSuccessEnabled(): Promise<boolean>
Checks whether vibration is enabled on successful barcode scanning.
setBarcodeThumbnailOnResultEnabled #
setBarcodeThumbnailOnResultEnabled(enabled): void
Enables or disables barcode thumbnails in scanning results.
Parameters:
| Name | Type |
|---|---|
| enabled | boolean |
setBeepOnSuccessEnabled #
setBeepOnSuccessEnabled(enabled): void
Enables or disables the audible beep sound upon successfully decoding a barcode.
Parameters:
| Name | Type |
|---|---|
| enabled | boolean |
setCloseSessionOnResultEnabled #
setCloseSessionOnResultEnabled(enabled): void
Enables or disables the automatic closing of the scanning session upon detecting a barcode result.
Parameters:
| Name | Type |
|---|---|
| enabled | boolean |
setReturnOnlyMatchedResults #
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:
| Name | Type |
|---|---|
value | boolean |
setImageResultEnabled #
setImageResultEnabled(enabled): void
Enables or disables the capturing and processing of image data when a barcode is successfully detected.
setMaximumResultsCount #
setMaximumResultsCount(maximumResultsCount): void
Sets the maximum number of results to be returned from barcode scanning.
Parameters:
| Name | Type |
|---|---|
| maximumResultsCount | number |
setMulticodeCachingDuration #
setMulticodeCachingDuration(multicodeCachingDuration): any
Sets the caching duration, in milliseconds, for multi-code results.
Parameters:
| Name | Type |
|---|---|
| multicodeCachingDuration | number |
setMulticodeCachingEnabled #
setMulticodeCachingEnabled(multicodeCachingEnabled): any
Enables or disables multi-code caching.
Parameters:
| Name | Type |
|---|---|
| multicodeCachingEnabled | boolean |
setThresholdBetweenDuplicatesScans #
setThresholdBetweenDuplicatesScans(thresholdBetweenDuplicatesScans): void
Sets the threshold between duplicate scans.
Parameters:
| Name | Type |
|---|---|
| thresholdBetweenDuplicatesScans | number |
setVibrateOnSuccessEnabled #
setVibrateOnSuccessEnabled(enabled): void
Enables or disables the device vibration upon successfully decoding a barcode.
Parameters:
| Name | Type |
|---|---|
| enabled | boolean |
captureImage #
captureImage(): void
Captures the latest camera frame.
getShowDuplicatesLocations #
getShowDuplicatesLocations(): Promise
Retrieves whether showing duplicate barcode locations in the AR view is enabled.
scanImage #
scanImage(base64, resultsCallback): void
Scan barcodes from base64 string image.
Parameters:
| Name | Type |
|---|---|
| base64 | String |
| resultsCallback | (result: Barkoder.BarkoderResult) => void |
setShowDuplicatesLocations #
setShowDuplicatesLocations(value): void
Enables or disables showing duplicate barcode locations on the preview overlay.
Parameters:
| Name | Type |
|---|---|
| value | boolean |
Region & overlay #
getLocationLineColorHex #
â–¸ getLocationLineColorHex(): Promise<string>
Retrieves the hexadecimal color code of the lines indicating detected barcode locations.
getLocationLineWidth #
â–¸ getLocationLineWidth(): Promise<number>
Retrieves the width of the lines indicating detected barcode locations on the camera preview.
getRegionOfInterest #
â–¸ getRegionOfInterest(): Promise<number[]>
Retrieves the Region of Interest (ROI).
getRoiLineColorHex #
â–¸ getRoiLineColorHex(): Promise<string>
Retrieves the hexadecimal color code of the lines outlining the Region of Interest (ROI).
getRoiLineWidth #
â–¸ getRoiLineWidth(): Promise<number>
Retrieves the width of the lines outlining the Region of Interest (ROI).
getRoiOverlayBackgroundColorHex #
â–¸ getRoiOverlayBackgroundColorHex(): Promise<string>
Retrieves the hexadecimal background color of the Region of Interest (ROI) overlay.
isLocationInImageResultEnabled #
â–¸ isLocationInImageResultEnabled(): Promise<boolean>
Checks whether barcode location information is included in the image result.
isRegionOfInterestVisible #
â–¸ isRegionOfInterestVisible(): Promise<boolean>
Checks whether the Region of Interest (ROI) is visible on the camera preview.
getRoiCenterMark #
getRoiCenterMark(): Promise
Retrieves the visual marker displayed at the center of the Region of Interest (ROI).
setLocationInImageResultEnabled #
setLocationInImageResultEnabled(enabled): void
Enables or disables the inclusion of barcode location information within the image data result
setLocationLineColor #
**setLocationLineColor**(hexColor):Â Promise<boolean>
Sets the color of the lines used to indicate the location of detected barcodes on the camera feed.
Parameters:
| Name | Type |
|---|---|
| hexColor | String |
setLocationLineWidth #
setLocationLineWidth(lineWidth): void
Sets the width of the lines indicating the location of detected barcodes on the camera feed.
Parameters:
| Name | Type |
|---|---|
| lineWidth | number |
setRegionOfInterest #
**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:
| Name | Type |
|---|---|
| left | number |
| top | number |
| width | number |
| height | number |
setRegionOfInterestVisible #
setRegionOfInterestVisible(visible): void
Sets the visibility of the Region of Interest (ROI) on the camera preview.
Parameters:
| Name | Type |
|---|---|
| visible | boolean |
setRoiCenterMark #
setRoiCenterMark(value): void
Sets the visual marker displayed at the center of the Region of Interest (ROI).
Parameters:
| Name | Type |
|---|---|
value | BarkoderRoiCenterMark |
setRoiLineColor #
**setRoiLineColor**(hexColor):Â Promise<boolean>
Sets the color of the lines outlining the Region of Interest (ROI) for barcode scanning on the camera feed.
Parameters:
| Name | Type |
|---|---|
| hexColor | String |
setRoiLineWidth #
setRoiLineWidth(lineWidth): void
Sets the width of the lines outlining the Region of Interest (ROI) for barcode scanning on the camera feed
Parameters:
| Name | Type |
|---|---|
| lineWidth | number |
setRoiOverlayBackgroundColor #
**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:
| Name | Type |
|---|---|
| hexColor | String |
getScanningIndicatorColorHex #
getScanningIndicatorColorHex(): Promise
Retrieves the hexadecimal color code representing the line color of the scanning indicator on the camera preview.
getScanningIndicatorWidth #
getScanningIndicatorWidth(): Promise
Retrieves the current width setting for the scanning indicator on the camera preview.
getScanningIndicatorAnimation #
getScanningIndicatorAnimation(): Promise
Retrieves the current animation setting for the scanning indicator on the camera preview.
isScanningIndicatorAlwaysVisible #
isScanningIndicatorAlwaysVisible(): Promise
Retrieves if the scanning indicator is set to be always visible on the camera preview.
setScanningIndicatorAlwaysVisible #
setScanningIndicatorAlwaysVisible(value): void
Sets whether the scanning indicator is always visible on the camera preview.
Parameters:
| Name | Type |
|---|---|
| value | boolean |
setScanningIndicatorColor #
setScanningIndicatorColor(hexColor): Promise<boolean>
Sets the scanning indicator color on the camera preview.
Parameters:
| Name | Type |
|---|---|
| hexColor | String |
setScanningIndicatorWidth #
setScanningIndicatorWidth(lineWidth): void
Sets the scanning indicator width on the camera preview.
Parameters:
| Name | Type |
|---|---|
| lineWidth | number |
setScanningIndicatorAnimation #
setScanningIndicatorAnimation(animation): void
Sets the scanning indicator animation on the camera preview.
Parameters:
| Name | Type |
|---|---|
| animation | number |
AR mode #
getARMode #
getARMode(): Promise
Retrieves the current AR mode used for barcode scanning.
getARReturnOnlyMatchedResults #
getARReturnOnlyMatchedResults(): Promise
Retrieves whether only matched results are returned in AR match filter mode.
getARDisplayOnlyMatchedResults #
getARDisplayOnlyMatchedResults(): Promise
Retrieves whether only matched results are displayed in AR match filter mode.
getARResultDisappearanceDelayMs #
getARResultDisappearanceDelayMs(): Promise
Retrieves the delay after which AR results disappear once detected.
getARLocationTransitionSpeed #
getARLocationTransitionSpeed(): Promise
Retrieves the transition speed for AR barcode location overlays.
getAROverlayRefresh #
â–¸ getAROverlayRefresh(): Promise<BarkoderAROverlayRefresh>
Retrieves the AR overlay refresh mode.
getARSelectedLocationColor #
getARSelectedLocationColor(): Promise
Retrieves the color used for selected barcode overlays in AR mode.
getARNonSelectedLocationColor #
getARNonSelectedLocationColor(): Promise
Retrieves the color used for non-selected barcode overlays in AR mode.
getARSelectedLocationLineWidth #
getARSelectedLocationLineWidth(): Promise
Retrieves the line width for selected barcode overlays in AR mode.
getARNonSelectedLocationLineWidth #
getARNonSelectedLocationLineWidth(): Promise
Retrieves the line width for non-selected barcode overlays in AR mode.
getARLocationType #
â–¸ getARLocationType(): Promise<BarkoderARLocationType>
Retrieves the style of AR location overlays (tight, bounding box, none).
getARResultLimit #
getARResultLimit(): Promise
Retrieves the maximum number of results allowed in a single AR scanning session.
getARContinueScanningOnLimit #
getARContinueScanningOnLimit(): Promise
Retrieves whether scanning continues when the result limit is reached (only in .interactiveDisabled mode).
getAREmitResultsAtSessionEndOnly #
getAREmitResultsAtSessionEndOnly(): Promise
Retrieves whether results are emitted only at AR session end (or when the limit is reached).
getARHeaderHeight #
getARHeaderHeight(): Promise
Retrieves the header height above barcode in AR mode.
getARHeaderShowMode #
â–¸ getARHeaderShowMode(): Promise<BarkoderARHeaderShowMode>
Retrieves the header display mode (always, on selected, never).
getARHeaderMaxTextHeight #
getARHeaderMaxTextHeight(): Promise
Retrieves the maximum text height for AR headers.
getARHeaderMinTextHeight #
getARHeaderMinTextHeight(): Promise
Retrieves the minimum text height for AR headers.
getARHeaderTextColorSelected #
getARHeaderTextColorSelected(): Promise
Retrieves the header text color for selected barcodes.
getARHeaderTextColorNonSelected #
getARHeaderTextColorNonSelected(): Promise
Retrieves the header text color for non-selected barcodes.
getARHeaderHorizontalTextMargin #
getARHeaderHorizontalTextMargin(): Promise
Retrieves the horizontal margin for AR header text.
getARHeaderVerticalTextMargin #
getARHeaderVerticalTextMargin(): Promise
Retrieves the vertical margin for AR header text.
getARHeaderTextFormat #
getARHeaderTextFormat(): Promise
Retrieves the format string used for AR header text.
isARDoubleTapToFreezeEnabled #
isARDoubleTapToFreezeEnabled(): Promise
Checks whether double-tap to freeze is enabled in AR mode.
isARImageResultEnabled #
isARImageResultEnabled(): Promise
Retrieves whether image result is enabled for AR mode.
isARBarcodeThumbnailOnResultEnabled #
isARBarcodeThumbnailOnResultEnabled(): Promise
Retrieves whether barcode thumbnail on result is enabled for AR mode.
resetARCache #
resetARCache(): void
Clears all cached barcode results from the current AR scanning session.
setARMode #
setARMode(value): void
Sets the AR mode used for barcode scanning visualization.
Parameters:
| Name | Type |
|---|---|
| value | BarkoderARMode |
setARReturnOnlyMatchedResults #
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:
| Name | Type |
|---|---|
value | boolean |
setARDisplayOnlyMatchedResults #
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:
| Name | Type |
|---|---|
value | boolean |
setARResultDisappearanceDelayMs #
setARResultDisappearanceDelayMs(value): void
Sets the delay, in milliseconds, after which a detected AR result is removed.
Parameters:
| Name | Type |
|---|---|
| value | number |
setARLocationTransitionSpeed #
setARLocationTransitionSpeed(value): void
Sets the transition speed of barcode location overlays in AR mode.
Parameters:
| Name | Type |
|---|---|
| value | number |
setAROverlayRefresh #
setAROverlayRefresh(value): void
Sets the AR overlay refresh mode.
Parameters:
| Name | Type |
|---|---|
| value | BarkoderAROverlayRefresh |
setARSelectedLocationColor #
setARSelectedLocationColor(hexColor): Promise<boolean>
Sets the color of selected barcode location overlays in AR mode.
Parameters:
| Name | Type |
|---|---|
| hexColor | string |
setARNonSelectedLocationColor #
setARNonSelectedLocationColor(hexColor): Promise<boolean>
Sets the color of non-selected barcode location overlays in AR mode.
Parameters:
| Name | Type |
|---|---|
| hexColor | string |
setARSelectedLocationLineWidth #
setARSelectedLocationLineWidth(value): void
Sets the line width of selected barcode location overlays in AR mode.
Parameters:
| Name | Type |
|---|---|
| value | number |
setARNonSelectedLocationLineWidth #
setARNonSelectedLocationLineWidth(value): void
Sets the line width of non-selected barcode location overlays in AR mode.
Parameters:
| Name | Type |
|---|---|
| value | number |
setARLocationType #
setARLocationType(value): void
Sets the style of barcode location overlays in AR mode: tight, bounding box, or none.
Parameters:
| Name | Type |
|---|---|
| value | BarkoderARLocationType |
setARDoubleTapToFreezeEnabled #
setARDoubleTapToFreezeEnabled(enabled): void
Enables or disables double-tap to freeze in AR mode.
Parameters:
| Name | Type |
|---|---|
| enabled | boolean |
setARImageResultEnabled #
setARImageResultEnabled(enabled): void
Enables or disables capturing image data when a barcode is selected in AR mode.
Parameters:
| Name | Type |
|---|---|
| enabled | boolean |
setARBarcodeThumbnailOnResultEnabled #
setARBarcodeThumbnailOnResultEnabled(enabled): void
Enables or disables barcode thumbnails in AR scanning results.
Parameters:
| Name | Type |
|---|---|
| enabled | boolean |
setARResultLimit #
setARResultLimit(value): void
Sets the maximum number of results allowed in a single AR scanning session.
Parameters:
| Name | Type |
|---|---|
| value | number |
setARContinueScanningOnLimit #
setARContinueScanningOnLimit(value): void
Sets whether scanning continues when the result limit is reached in interactiveDisabled AR mode.
Parameters:
| Name | Type |
|---|---|
| value | boolean |
setAREmitResultsAtSessionEndOnly #
setAREmitResultsAtSessionEndOnly(value): void
Sets whether results are emitted only at the end of an AR session or when the result limit is reached.
Parameters:
| Name | Type |
|---|---|
| value | boolean |
setARHeaderHeight #
setARHeaderHeight(value): void
Sets the height of the header label shown above barcodes in AR mode.
Parameters:
| Name | Type |
|---|---|
| value | number |
setARHeaderShowMode #
setARHeaderShowMode(value): void
Sets when the AR header is displayed: always, on selected barcodes, or never.
Parameters:
| Name | Type |
|---|---|
| value | BarkoderARHeaderShowMode |
setARHeaderMaxTextHeight #
setARHeaderMaxTextHeight(value): void
Sets the maximum height of AR header text.
Parameters:
| Name | Type |
|---|---|
| value | number |
setARHeaderMinTextHeight #
setARHeaderMinTextHeight(value): void
Sets the minimum height of AR header text.
Parameters:
| Name | Type |
|---|---|
| value | number |
setARHeaderTextColorSelected #
setARHeaderTextColorSelected(hexColor): Promise<boolean>
Sets the header text color for selected barcodes in AR mode.
Parameters:
| Name | Type |
|---|---|
| hexColor | string |
setARHeaderTextColorNonSelected #
setARHeaderTextColorNonSelected(hexColor): Promise<boolean>
Sets the header text color for non-selected barcodes in AR mode.
Parameters:
| Name | Type |
|---|---|
| hexColor | string |
setARHeaderHorizontalTextMargin #
setARHeaderHorizontalTextMargin(value): void
Sets the horizontal margin on both sides of AR header text.
Parameters:
| Name | Type |
|---|---|
| value | number |
setARHeaderVerticalTextMargin #
setARHeaderVerticalTextMargin(value): void
Sets the vertical margin above and below AR header text.
Parameters:
| Name | Type |
|---|---|
| value | number |
setARHeaderTextFormat #
setARHeaderTextFormat(value): void
Sets the format string used for AR header text.
Parameters:
| Name | Type |
|---|---|
| value | string |
On-screen buttons #
configureCloseButton #
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:
| Name | Type |
|---|---|
| visible | boolean |
| positionX | number |
| positionY | number |
| iconSize | number |
| tintColor | string |
| backgroundColor | string |
| cornerRadius | number |
| padding | number |
| useCustomIcon | boolean |
| customIcon | string |
configureFlashButton #
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:
| Name | Type |
|---|---|
| visible | boolean |
| positionX | number |
| positionY | number |
| iconSize | number |
| tintColor | string |
| backgroundColor | string |
| cornerRadius | number |
| padding | number |
| useCustomIcon | boolean |
| customIconFlashOn | string |
| customIconFlashOff | string |
configureZoomButton #
configureZoomButton(visible, positionX, positionY, iconSize, tintColor, backgroundColor, cornerRadius, padding, useCustomIcon, customIconZoomedIn, customIconZoomedOut, zoomedInFactor, zoomedOutFactor): void
Configures the zoom button shown during scanning.
Parameters:
| Name | Type |
|---|---|
| visible | boolean |
| positionX | number |
| positionY | number |
| iconSize | number |
| tintColor | string |
| backgroundColor | string |
| cornerRadius | number |
| padding | number |
| useCustomIcon | boolean |
| customIconZoomedIn | string |
| customIconZoomedOut | string |
| zoomedInFactor | number |
| zoomedOutFactor | number |
onCloseButtonTapped #
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:
| Name | Type |
|---|---|
| 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 #
| Property | Type | Description |
|---|---|---|
| decoderResults | Barkoder.DecoderResult[] | Native decoder results converted into Barkoder.DecoderResult instances. Set to [] if the input is not an array. |
| resultThumbnailsAsBase64? | string[] or null | JPEG 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 null | Full 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 #
| Property | Type | Description |
|---|---|---|
| barcodeType | number | Native barcode-type numeric value, copied without conversion. See Barkoder.BarcodeType. |
| barcodeTypeName | string | Native barcode-type name, copied without renaming. |
| binaryDataAsBase64 | string | Barcode binary data encoded as plain Base64. The wrapper does not add a data-URL prefix or decode the bytes. |
| textualData | string | Native decoded text, copied without conversion. |
| characterSet? | string or null | Native character-set string. Missing, null, or empty input becomes null. |
| extra? | Record<string, any> or null | The 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 null | SADL 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. |
| isMatched | boolean | Native 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.
| Property | Type | Description |
|---|---|---|
| name | string | Native image name. Both bridges include only main, document, signature, and picture. These are possible names, not a guarantee that any or all are returned. |
| base64 | string | Image 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.
| Property | Type | Description |
|---|---|---|
| x | number | Native location point's x value, forwarded unchanged. |
| y | number | Native 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 #
| Member | Value |
|---|---|
fast | 0 |
normal | 1 |
slow | 2 |
rigorous | 3 |
Barkoder.FormattingType #
| Member | Value |
|---|---|
disabled | 0 |
automatic | 1 |
gs1 | 2 |
aamva | 3 |
sadl | 4 |
bcbp | 5 |
Barkoder.MsiChecksumType #
| Member | Value |
|---|---|
disabled | 0 |
mod10 | 1 |
mod11 | 2 |
mod1010 | 3 |
mod1110 | 4 |
mod11IBM | 5 |
mod1110IBM | 6 |
Barkoder.Code39ChecksumType #
| Member | Value |
|---|---|
disabled | 0 |
enabled | 1 |
Barkoder.Code11ChecksumType #
| Member | Value |
|---|---|
disabled | 0 |
single | 1 |
double | 2 |
Barkoder.BarkoderCameraPosition #
| Member | Value |
|---|---|
BACK | 0 |
FRONT | 1 |
Barkoder.BarkoderResolution #
| Member | Value |
|---|---|
HD | 0 |
FHD | 1 |
UHD | 2 |
Barkoder.BarkoderRoiCenterMark #
| Member | Value |
|---|---|
none | 0 |
crosshair | 1 |
point | 2 |
Barkoder.BarkoderARMode #
| Member | Value |
|---|---|
off | 0 |
interactiveDisabled | 1 |
interactiveEnabled | 2 |
nonInteractive | 3 |
matchFilter | 4 |
Barkoder.BarkoderAROverlayRefresh #
| Member | Value |
|---|---|
smooth | 0 |
normal | 1 |
Barkoder.BarkoderARLocationType #
| Member | Value |
|---|---|
none | 0 |
tight | 1 |
boundingBox | 2 |
Barkoder.BarkoderARHeaderShowMode #
| Member | Value |
|---|---|
never | 0 |
always | 1 |
onSelected | 2 |
Barkoder.BarcodeType #
| Member | Value |
|---|---|
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 |
Barkoder.IdDocumentMasterChecksumType #
| Member | Value |
|---|---|
disabled | 0 |
enabled | 1 |
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 #
| Property | Type | Description |
|---|---|---|
| licenseKey | string | License key passed to the native view to create its configuration. |
| style | ViewStyle | React Native view style. |
| onBarkoderViewCreated | (barkoder: Barkoder) => void | Called 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.