On this page

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

Capacitor API reference

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

Scanning & session #

initialize #

TypeScript
initialize(options: { width: number; height: number; x: number; y: number; }) => Promise<any>
ParamType
options{ width: number; height: number; x: number; y: number; }

Returns: Promise<any>

registerWithLicenseKey #

TypeScript
registerWithLicenseKey(options: { licenseKey: string; }) => Promise<any>
ParamType
options{ licenseKey: string; }

Returns: Promise<any>

startScanning #

TypeScript
startScanning() => Promise<any>

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

Returns: Promise<any>

stopScanning #

TypeScript
stopScanning() => Promise<any>

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

Returns: Promise<any>

pauseScanning #

TypeScript
pauseScanning() => Promise<any>

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

Returns: Promise<any>

freezeScanning #

TypeScript
freezeScanning() => Promise<any>

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.

Returns: Promise<any>

unfreezeScanning #

TypeScript
unfreezeScanning() => Promise<any>

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.

Returns: Promise<any>

setThreadsLimit #

TypeScript
setThreadsLimit(options: { value: number; }) => Promise<any>

Sets the threads limit

ParamType
options{ value: number; }

Returns: Promise<any>

setDecodingSpeed #

TypeScript
setDecodingSpeed(options: { value: DecodingSpeed; }) => Promise<any>

Sets the decoding speed for barcode scanning

ParamType
options{ value: DecodingSpeed; }

Returns: Promise<any>

setMatchFilter #

TypeScript
setMatchFilter(options: { value: string; }) => Promise

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

ParamType
options{ value: string; }

Returns: Promise<any>

configureBarkoder #

TypeScript
configureBarkoder(options: { barkoderConfig: BarkoderConfig; }) => Promise<any>

Configures the Barkoder functionality based on the provided configuration

ParamType
options{ barkoderConfig: BarkoderConfig; }

Returns: Promise<any>

setUPCEexpandToUPCA #

TypeScript
setUPCEexpandToUPCA(options: { value: boolean; }) => Promise<any>

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

ParamType
options{ value: boolean; }

Returns: Promise<any>

setUPCE1expandToUPCA #

TypeScript
setUPCE1expandToUPCA(options: { value: boolean; }) => Promise<any>

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

ParamType
options{ value: boolean; }

Returns: Promise<any>

setDynamicExposure #

TypeScript
setDynamicExposure(options: { value: number; }) => Promise<any>

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

ParamType
options{ value: number; }

Returns: Promise<any>

setVideoStabilization #

TypeScript
setVideoStabilization(options: { value: boolean; }) => Promise<any>

Enable or disable video stabilization for smoother video capture

ParamType
options{ value: boolean; }

Returns: Promise<any>

selectVisibleBarcodes #

TypeScript
selectVisibleBarcodes() => Promise<any>

Selects all barcodes that are currently visible in AR mode.

Returns: Promise<any>

setPowerSavingMode #

TypeScript
setPowerSavingMode(options: { value: number; }) => Promise<any>

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

ParamType
options{ value: number; }

Returns: Promise<any>

getVersion #

TypeScript
getVersion() => Promise<any>

Retrieves the version of the Barkoder SDK

Returns: Promise<any>

getLibVersion #

TypeScript
getLibVersion() => Promise<any>

Retrieves the version of the Barkoder library

Returns: Promise<any>

getDeviceId #

TypeScript
getDeviceId() => Promise

Retrieves the Device ID.

Returns: Promise<any>

getDecodingSpeed #

TypeScript
getDecodingSpeed() => Promise<any>

Retrieves the current decoding speed setting for barcode scanning

Returns: Promise<any>

getMatchFilter #

TypeScript
getMatchFilter() => Promise

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

Returns: Promise<any>

getThreadsLimit #

TypeScript
getThreadsLimit() => Promise<any>

Retrieves the threads limit

Returns: Promise<any>

getPowerSavingMode #

TypeScript
getPowerSavingMode() => Promise<any>

Retrieves the power saving mode level.

Returns: Promise<any>

Enums -----

The following enums are exported from barkoder-capacitor. Member names are case-sensitive. Import enums directly from the package.

These declarations describe the plugin's public values. Image fields are only populated when the native SDK supplies the corresponding images.

DecodingSpeed #

Values for setDecodingSpeed(...) and the decodingSpeed configuration property.

MemberValue
fast0
normal1
slow2
rigorous3

Example:

TypeScript
import { Barkoder, DecodingSpeed } from 'barkoder-capacitor';

Barkoder.setDecodingSpeed({ value: DecodingSpeed.normal });

Camera #

setZoomFactor #

TypeScript
setZoomFactor(options: { value: number; }) => Promise<any>

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

ParamType
options{ value: number; }

Returns: Promise<any>

setFlashEnabled #

TypeScript
setFlashEnabled(options: { enabled: boolean; }) => Promise<any>

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

ParamType
options{ enabled: boolean; }

Returns: Promise<any>

startCamera #

TypeScript
startCamera() => Promise<any>

Returns: Promise<any>

setLocationInPreviewEnabled #

TypeScript
setLocationInPreviewEnabled(options: { enabled: boolean; }) => Promise<any>

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

ParamType
options{ enabled: boolean; }

Returns: Promise<any>

setPinchToZoomEnabled #

TypeScript
setPinchToZoomEnabled(options: { enabled: boolean; }) => Promise<any>

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

ParamType
options{ enabled: boolean; }

Returns: Promise<any>

setBarkoderResolution #

TypeScript
setBarkoderResolution(options: { value: BarkoderResolution; }) => Promise<any>

Sets the resolution for barcode scanning

ParamType
options{ value: BarkoderResolution; }

Returns: Promise<any>

setCentricFocusAndExposure #

TypeScript
setCentricFocusAndExposure(options: { value: boolean; }) => Promise<any>

Set the camera to use the center of the viewfinder for focus and exposure

ParamType
options{ value: boolean; }

Returns: Promise<any>

setCamera #

TypeScript
setCamera(options: { value: BarkoderCameraPosition; }) => Promise<any>

Sets the camera to be used for scanning (back/front)

ParamType
options{ value: BarkoderCameraPosition; }

Returns: Promise<any>

setPreviewMirrored #

TypeScript
setPreviewMirrored(options: { value: boolean; }) => Promise

Controls whether the front camera preview is horizontally mirrored.

ParamType
options{ value: boolean; }

Returns: Promise<any>

isFlashAvailable #

TypeScript
isFlashAvailable() => Promise<any>

Checks whether the device has a built-in flash (torch) that can be used for illumination during barcode scanning

Returns: Promise<any>

isLocationInPreviewEnabled #

TypeScript
isLocationInPreviewEnabled() => Promise<any>

Checks if location in preview is enabled

Returns: Promise<any>

isPinchToZoomEnabled #

TypeScript
isPinchToZoomEnabled() => Promise<any>

Checks if pinch to zoom is enabled

Returns: Promise<any>

isPreviewMirrored #

TypeScript
isPreviewMirrored() => Promise<any>

Retrieves whether the front camera preview is horizontally mirrored.

Returns: Promise<any>

getMaxZoomFactor #

TypeScript
getMaxZoomFactor() => Promise<any>

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

Returns: Promise<any>

getCurrentZoomFactor #

TypeScript
getCurrentZoomFactor() => Promise<any>

Retrieves the current zoom factor for the device's camera

Returns: Promise<any>

getBarkoderResolution #

TypeScript
getBarkoderResolution() => Promise<any>

Retrieves the resolution for barcode scanning

Returns: Promise<any>

BarkoderCameraPosition #

Values for setCamera(...).

MemberValue
BACK0
FRONT1

Example:

TypeScript
import { Barkoder, BarkoderCameraPosition } from 'barkoder-capacitor';

Barkoder.setCamera({ value: BarkoderCameraPosition.FRONT });

BarkoderResolution #

Values for setBarkoderResolution(...) and the barkoderResolution configuration property.

MemberValue
HD0
FHD1
UHD2

Barcode types #

setBarcodeTypeLengthRange #

TypeScript
setBarcodeTypeLengthRange(options: { type: BarcodeType; min: number; max: number; }) => Promise<any>

Sets the length range for the specified barcode type

ParamType
options{ type: BarcodeType; min: number; max: number; }

Returns: Promise<any>

setEncodingCharacterSet #

TypeScript
setEncodingCharacterSet(options: { value: string; }) => Promise<any>

Sets the encoding character set for barcode scanning

ParamType
options{ value: string; }

Returns: Promise<any>

setFormattingType #

TypeScript
setFormattingType(options: { value: FormattingType; }) => Promise<any>

Sets the formatting type for barcode scanning

ParamType
options{ value: FormattingType; }

Returns: Promise<any>

setCode11ChecksumType #

TypeScript
setCode11ChecksumType(options: { value: number; }) => Promise<any>

Sets the Code11 checksum type

ParamType
options{ value: number; }

Returns: Promise<any>

setMsiChecksumType #

TypeScript
setMsiChecksumType(options: { value: number; }) => Promise<any>

Sets the MSI checksum type

ParamType
options{ value: number; }

Returns: Promise<any>

setCode39ChecksumType #

TypeScript
setCode39ChecksumType(options: { value: number; }) => Promise<any>

Sets the Code39 checksum type

ParamType
options{ value: number; }

Returns: Promise<any>

setBarcodeTypeEnabled #

TypeScript
setBarcodeTypeEnabled(options: { type: BarcodeType; enabled: boolean; }) => Promise<any>

Sets whether a specific barcode type is enabled

ParamType
options{ type: BarcodeType; enabled: boolean; }

Returns: Promise<any>

setUpcEanDeblurEnabled #

TypeScript
setUpcEanDeblurEnabled(options: { enabled: boolean; }) => Promise<any>

Sets whether the deblurring feature for UPC/EAN barcodes is enabled

ParamType
options{ enabled: boolean; }

Returns: Promise<any>

setMisshaped1DEnabled #

TypeScript
setMisshaped1DEnabled(options: { enabled: boolean; }) => Promise<any>

Sets whether the detection of misshaped 1D barcodes is enabled

ParamType
options{ enabled: boolean; }

Returns: Promise<any>

setEnableVINRestrictions #

TypeScript
setEnableVINRestrictions(options: { value: boolean; }) => Promise<any>

Sets whether Vehicle Identification Number (VIN) restrictions are enabled

ParamType
options{ value: boolean; }

Returns: Promise<any>

setDatamatrixDpmModeEnabled #

TypeScript
setDatamatrixDpmModeEnabled(options: { enabled: boolean; }) => Promise<any>

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

ParamType
options{ enabled: boolean; }

Returns: Promise<any>

setQrDpmModeEnabled #

TypeScript
setQrDpmModeEnabled(options: { enabled: boolean; }) => Promise<any>

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

ParamType
options{ enabled: boolean; }

Returns: Promise<any>

setQrMicroDpmModeEnabled #

TypeScript
setQrMicroDpmModeEnabled(options: { enabled: boolean; }) => Promise<any>

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

ParamType
options{ enabled: boolean; }

Returns: Promise<any>

setQrMultiPartMergeEnabled #

TypeScript
setQrMultiPartMergeEnabled(options: { enabled: boolean; }) => Promise<any>

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

ParamType
options{ enabled: boolean; }

Returns: Promise<any>

setIdDocumentMasterChecksumEnabled #

TypeScript
setIdDocumentMasterChecksumEnabled(options: { enabled: boolean; }) => Promise<any>

Sets whether Master checksum should be requiered when scanning ID Documents

ParamType
options{ enabled: boolean; }

Returns: Promise<any>

setCustomOption #

TypeScript
setCustomOption(options: { option: string; value: number; }) => Promise<any>

Sets a custom option with a string option and integer value

See more details about available options and their values.

ParamType
options{ option: string; value: number; }

Returns: Promise<any>

setCustomOptionGlobal #

TypeScript
setCustomOptionGlobal(options: { option: string; value: number; }) => Promise<any>

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

ParamType
options{ option: string; value: number; }

Returns: Promise<any>

setEnableComposite #

TypeScript
setEnableComposite(options: { value: number; }) => Promise<any>

Sets wheter Composite Mode should be enabled when scanning

ParamType
options{ value: number; }

Returns: Promise<any>

getBarcodeTypeLengthRange #

TypeScript
getBarcodeTypeLengthRange(options: { type: number; }) => Promise<any>

Retrieves the length range of a specific barcode type

ParamType
options{ type: number; }

Returns: Promise<any>

getMsiChecksumType #

TypeScript
getMsiChecksumType() => Promise<any>

Retrieves the MSI checksum type

Returns: Promise<any>

getCode39ChecksumType #

TypeScript
getCode39ChecksumType() => Promise<any>

Retrieves the checksum type for Code 39 barcodes

Returns: Promise<any>

getCode11ChecksumType #

TypeScript
getCode11ChecksumType() => Promise<any>

Retrieves the Code11 checksum type

Returns: Promise<any>

getEncodingCharacterSet #

TypeScript
getEncodingCharacterSet() => Promise<any>

Retrieves the character set used for encoding barcode data

Returns: Promise<any>

getFormattingType #

TypeScript
getFormattingType() => Promise<any>

Retrieves the formatting type used for presenting decoded barcode data.

Returns: Promise<any>

isBarcodeTypeEnabled #

TypeScript
isBarcodeTypeEnabled(options: { type: number; }) => Promise<any>

Checks if a specific barcode type is enabled

ParamType
options{ type: number; }

Returns: Promise<any>

isUpcEanDeblurEnabled #

TypeScript
isUpcEanDeblurEnabled() => Promise<any>

Retrieves the value indicating whether deblurring is enabled for UPC/EAN barcodes

Returns: Promise<any>

isMisshaped1DEnabled #

TypeScript
isMisshaped1DEnabled() => Promise<any>

Checks if the detection of misshaped 1D barcodes is enabled

Returns: Promise<any>

isVINRestrictionsEnabled #

TypeScript
isVINRestrictionsEnabled() => Promise<any>

Checks if VIN restrictions are enabled

Returns: Promise<any>

isDatamatrixDpmModeEnabled #

TypeScript
isDatamatrixDpmModeEnabled() => Promise<any>

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

Returns: Promise<any>

isQrDpmModeEnabled #

TypeScript
isQrDpmModeEnabled() => Promise<any>

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

Returns: Promise<any>

isQrMicroDpmModeEnabled #

TypeScript
isQrMicroDpmModeEnabled() => Promise<any>

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

Returns: Promise<any>

isQrMultiPartMergeEnabled #

TypeScript
isQrMultiPartMergeEnabled() => Promise<any>

Retrieves whether the QR multi-part merge mode is enabled

Returns: Promise<any>

isIdDocumentMasterChecksumEnabled #

TypeScript
isIdDocumentMasterChecksumEnabled() => Promise<any>

Retrieves whether Master checksum is enabled when scanning ID Documents

Returns: Promise<any>

FormattingType #

Values for setFormattingType(...) and the formattingType configuration property.

MemberValue
disabled0
automatic1
gs12
aamva3
sadl4
bcbp5

Example:

TypeScript
import { Barkoder, FormattingType } from 'barkoder-capacitor';

Barkoder.setFormattingType({ value: FormattingType.bcbp });

MsiChecksumType #

Values for setMsiChecksumType(...) and the MSI checksum configuration property.

MemberValue
disabled0
mod101
mod112
mod10103
mod11104
mod11IBM5
mod1110IBM6

Code39ChecksumType #

Values for setCode39ChecksumType(...) and the Code 39 checksum configuration property.

MemberValue
disabled0
enabled1

Code11ChecksumType #

Values for setCode11ChecksumType(...) and the Code 11 checksum configuration property.

MemberValue
disabled0
single1
double2

Example:

TypeScript
import { Barkoder, Code11ChecksumType } from 'barkoder-capacitor';

Barkoder.setCode11ChecksumType({ value: Code11ChecksumType.single });

BarcodeType #

Values identifying barcode types, including the type parameter of setBarcodeTypeEnabled(...) and setBarcodeTypeLengthRange(...).

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

Example:

TypeScript
import { Barkoder, BarcodeType } from 'barkoder-capacitor';

Barkoder.setBarcodeTypeEnabled({ type: BarcodeType.qr, enabled: true });

IdDocumentMasterChecksumType #

Values for the masterChecksum property of IdDocumentBarcodeConfig.

MemberValue
disabled0
enabled1

Events and scanning results --------------------------

The Android and iOS implementations emit scan results through barkoderResultEvent. The event data contains a decoderResults array and may contain result images and thumbnails.

Results #

captureImage #

TypeScript
captureImage() => Promise<any>

Captures the latest camera frame

Returns: Promise<any>

scanImage #

TypeScript
scanImage(options: { base64: string; }) => Promise<any>

Scan barcodes from base64 string image

ParamType
options{ base64: string; }

Returns: Promise<any>

setCloseSessionOnResultEnabled #

TypeScript
setCloseSessionOnResultEnabled(options: { enabled: boolean; }) => Promise<any>

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

ParamType
options{ enabled: boolean; }

Returns: Promise<any>

setImageResultEnabled #

TypeScript
setImageResultEnabled(options: { enabled: boolean; }) => Promise<any>

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

ParamType
options{ enabled: boolean; }

Returns: Promise<any>

setBeepOnSuccessEnabled #

TypeScript
setBeepOnSuccessEnabled(options: { enabled: boolean; }) => Promise<any>

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

ParamType
options{ enabled: boolean; }

Returns: Promise<any>

setVibrateOnSuccessEnabled #

TypeScript
setVibrateOnSuccessEnabled(options: { enabled: boolean; }) => Promise<any>

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

ParamType
options{ enabled: boolean; }

Returns: Promise<any>

setReturnOnlyMatchedResults #

TypeScript
setReturnOnlyMatchedResults(options: { value: boolean; }) => Promise

Controls whether only results matching matchFilter are returned.

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

This option only applies when a match filter is active.

ParamType
options{ value: boolean; }

Returns: Promise<any>

setMulticodeCachingEnabled #

TypeScript
setMulticodeCachingEnabled(options: { enabled: boolean; }) => Promise<any>

Sets whether multi-code caching is enabled

ParamType
options{ enabled: boolean; }

Returns: Promise<any>

setMulticodeCachingDuration #

TypeScript
setMulticodeCachingDuration(options: { value: number; }) => Promise<any>

Sets the caching duration (in milliseconds) for multi-code results

ParamType
options{ value: number; }

Returns: Promise<any>

setMaximumResultsCount #

TypeScript
setMaximumResultsCount(options: { value: number; }) => Promise<any>

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

ParamType
options{ value: number; }

Returns: Promise<any>

setBarcodeThumbnailOnResultEnabled #

TypeScript
setBarcodeThumbnailOnResultEnabled(options: { enabled: boolean; }) => Promise<any>

A boolean indicating whether to enable barcode thumbnail on result.

ParamType
options{ enabled: boolean; }

Returns: Promise<any>

setThresholdBetweenDuplicatesScans #

TypeScript
setThresholdBetweenDuplicatesScans(options: { value: number; }) => Promise<any>

Sets the threshold between duplicate scans

ParamType
options{ value: number; }

Returns: Promise<any>

setShowDuplicatesLocations #

TypeScript
setShowDuplicatesLocations(options: { value: boolean; }) => Promise<any>

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

ParamType
options{ value: boolean; }

Returns: Promise<any>

isCloseSessionOnResultEnabled #

TypeScript
isCloseSessionOnResultEnabled() => Promise<any>

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

Returns: Promise<any>

isImageResultEnabled #

TypeScript
isImageResultEnabled() => Promise<any>

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

Returns: Promise<any>

isBeepOnSuccessEnabled #

TypeScript
isBeepOnSuccessEnabled() => Promise<any>

Retrieves the value indicating whether a beep sound is played on successful barcode scanning

Returns: Promise<any>

isVibrateOnSuccessEnabled #

TypeScript
isVibrateOnSuccessEnabled() => Promise<any>

Retrieves the value indicating whether vibration is enabled on successful barcode scanning

Returns: Promise<any>

getReturnOnlyMatchedResults #

TypeScript
getReturnOnlyMatchedResults() => Promise

Retrieves whether only results matching matchFilter are returned.

Returns: Promise<any>

getMaximumResultsCount #

TypeScript
getMaximumResultsCount() => Promise<any>

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

Returns: Promise<any>

getMulticodeCachingEnabled #

TypeScript
getMulticodeCachingEnabled() => Promise<any>

Retrieves whether multi-code caching is enabled

Returns: Promise<any>

getMulticodeCachingDuration #

TypeScript
getMulticodeCachingDuration() => Promise<any>

Retrieves the caching duration (in milliseconds) for multi-code results

Returns: Promise<any>

isBarcodeThumbnailOnResultEnabled #

TypeScript
isBarcodeThumbnailOnResultEnabled() => Promise<any>

Retrieve whether to enable barcode thumbnail on result

Returns: Promise<any>

getThresholdBetweenDuplicatesScans #

TypeScript
getThresholdBetweenDuplicatesScans() => Promise<any>

Retrieves the threshold between duplicate scans

Returns: Promise<any>

getShowDuplicatesLocations #

TypeScript
getShowDuplicatesLocations() => Promise<any>

Retrieves whether showing duplicate barcode locations is enabled.

Returns: Promise<any>

barkoderResultEvent #

Register a listener before starting scanning. Pass the raw event data to BarkoderResult to obtain the result models described below.

Example:

TypeScript
import { Barkoder, BarkoderResult } from 'barkoder-capacitor';

const listener = Barkoder.addListener('barkoderResultEvent', data => {
  const result = new BarkoderResult(data);

  for (const decoderResult of result.decoderResults) {
    console.log(decoderResult.barcodeTypeName, decoderResult.textualData);

    if (decoderResult.locationPoints) {
      console.log(decoderResult.locationPoints);
    }

    for (const image of decoderResult.mrzImagesAsBase64 ?? []) {
      console.log(image.name, image.base64);
    }
  }
});

Barkoder.startScanning();

After the application no longer needs this subscription, remove it with listener.then(handle => handle.remove()). The listener variable holds the promise returned by addListener(...), not the resolved listener handle.

Raw event data is not already a BarkoderResult instance. In particular, raw image fields contain Base64-encoded JPEG data without a data URL prefix, and raw extra values are JSON strings when present.

The BarkoderResult and DecoderResult constructors convert image strings into JPEG data URLs and parse extra. Construct the models from raw event data, not from data that has already been converted.

BarkoderResult #

new BarkoderResult(resultMap: Record<string, any>)

Wraps raw scanning event data and creates a DecoderResult instance for each item in decoderResults.

Property names ending in ? are declared optional in the public TypeScript API. The descriptions explain the values assigned by the constructor.

PropertyTypeDescription
decoderResultsDecoderResult[]Array of decoded barcode results. The constructor creates a DecoderResult instance for each item, or uses an empty array if the input does not contain a results array.
resultThumbnailsAsBase64?string[] or nullBarcode thumbnails as JPEG data URLs beginning with data:image/jpeg;base64,. Uses null if no thumbnail array is supplied. Empty thumbnail values are removed from supplied arrays.
resultImageAsBase64?string or nullResult image as a JPEG data URL beginning with data:image/jpeg;base64,. Uses null if no non-empty image value is supplied.

DecoderResult #

new DecoderResult(resultMap: Record<string, any>)

Represents one decoded barcode. Instances are created by the BarkoderResult constructor.

Property names ending in ? are declared optional in the public TypeScript API. Image and location data are only available when supplied by the native result.

PropertyTypeDescription
barcodeTypenumberNumeric barcode type identifier. See BarcodeType.
barcodeTypeNamestringBarcode type name reported by the native decoder.
binaryDataAsBase64stringDecoded barcode binary data encoded as Base64. This is not an image data URL and is not converted by the constructor.
textualDatastringDecoded textual barcode data.
characterSet?string or nullCharacter set reported by the native decoder. Uses null when absent or empty.
extra?Record<string, any> or nullAdditional result fields. The constructor parses the raw event's JSON string into an object, or uses null if absent. Available keys depend on the result.
isMatchedbooleanMatch status reported by the native decoder. See setMatchFilter(...), setReturnOnlyMatchedResults(...), and setARReturnOnlyMatchedResults(...).
locationPoints?{ x: number; y: number }[]Location points with numeric x and y coordinates. Preserves the supplied array, or uses undefined if absent. Do not assume these coordinates map directly to CSS positions on the preview.
mrzImagesAsBase64?{ name: string; base64: string }[]Available MRZ images named main, document, signature, or picture. Each base64 value is converted to a JPEG data URL. Uses an empty array if no MRZ image array is supplied; not every result includes every image.
sadlImageAsBase64?string or nullSouth African driver's license image extracted from result metadata, converted to a JPEG data URL. Uses null if no non-empty image value is supplied.

Region & overlay #

setLocationLineColor #

TypeScript
setLocationLineColor(options: { value: string; }) => Promise<any>

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

ParamType
options{ value: string; }

Returns: Promise<any>

setLocationLineWidth #

TypeScript
setLocationLineWidth(options: { value: number; }) => Promise<any>

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

ParamType
options{ value: number; }

Returns: Promise<any>

setRoiLineColor #

TypeScript
setRoiLineColor(options: { value: string; }) => Promise<any>

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

ParamType
options{ value: string; }

Returns: Promise<any>

setRoiLineWidth #

TypeScript
setRoiLineWidth(options: { value: number; }) => Promise<any>

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

ParamType
options{ value: number; }

Returns: Promise<any>

setRoiOverlayBackgroundColor #

TypeScript
setRoiOverlayBackgroundColor(options: { value: string; }) => Promise<any>

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

ParamType
options{ value: string; }

Returns: Promise<any>

setLocationInImageResultEnabled #

TypeScript
setLocationInImageResultEnabled(options: { enabled: boolean; }) => Promise<any>

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

ParamType
options{ enabled: boolean; }

Returns: Promise<any>

setRegionOfInterest #

TypeScript
setRegionOfInterest(options: { left: number; top: number; width: number; height: number; }) => Promise<any>

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

ParamType
options{ left: number; top: number; width: number; height: number; }

Returns: Promise<any>

setRegionOfInterestVisible #

TypeScript
setRegionOfInterestVisible(options: { value: boolean; }) => Promise<any>

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

ParamType
options{ value: boolean; }

Returns: Promise<any>

setRoiCenterMark #

TypeScript
setRoiCenterMark(options: { value: BarkoderRoiCenterMark; }) => Promise

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

ParamType
options{ value: BarkoderRoiCenterMark; }

Returns: Promise<any>

setScanningIndicatorColor #

TypeScript
setScanningIndicatorColor(options: { value: string; }) => Promise<any>

Sets the color of the lines outlining the scanning indicator for barcode scanning on the camera feed

ParamType
options{ value: string; }

Returns: Promise<any>

setScanningIndicatorWidth #

TypeScript
setScanningIndicatorWidth(options: { value: number; }) => Promise<any>

Sets the width of the scanning indicator for barcode scanning on the camera feed

ParamType
options{ value: number; }

Returns: Promise<any>

setScanningIndicatorAnimation #

TypeScript
setScanningIndicatorAnimation(options: { value: number; }) => Promise<any>

Sets the animation of the scanning indicator for barcode scanning on the camera feed

ParamType
options{ value: number; }

Returns: Promise<any>

setScanningIndicatorAlwaysVisible #

TypeScript
setScanningIndicatorAlwaysVisible(options: { value: boolean; }) => Promise<any>

Sets the scanning indicator to be always shown on the camera feed

ParamType
options{ value: boolean; }

Returns: Promise<any>

isLocationInImageResultEnabled #

TypeScript
isLocationInImageResultEnabled() => Promise<any>

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

Returns: Promise<any>

isRegionOfInterestVisible #

TypeScript
isRegionOfInterestVisible() => Promise<any>

Checks if the region of interest (ROI) is visible

Returns: Promise<any>

getRoiCenterMark #

TypeScript
getRoiCenterMark() => Promise

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

Returns: Promise<any>

getLocationLineColorHex #

TypeScript
getLocationLineColorHex() => Promise<any>

Retrieves the hexadecimal color code representing the line color used to indicate the location of detected barcodes

Returns: Promise<any>

getRoiLineColorHex #

TypeScript
getRoiLineColorHex() => Promise<any>

Retrieves the hexadecimal color code representing the line color of the Region of Interest (ROI) on the camera preview

Returns: Promise<any>

getRoiOverlayBackgroundColorHex #

TypeScript
getRoiOverlayBackgroundColorHex() => Promise<any>

Retrieves the hexadecimal color code representing the background color of the overlay within the Region of Interest (ROI) on the camera preview

Returns: Promise<any>

getLocationLineWidth #

TypeScript
getLocationLineWidth() => Promise<any>

Retrieves the current width setting for the lines indicating the location of detected barcodes on the camera feed

Returns: Promise<any>

getRoiLineWidth #

TypeScript
getRoiLineWidth() => Promise<any>

Retrieves the current width setting for the lines outlining the Region of Interest (ROI) on the camera preview

Returns: Promise<any>

getRegionOfInterest #

TypeScript
getRegionOfInterest() => Promise<any>

Retrieves the region of interest (ROI)

Returns: Promise<any>

getScanningIndicatorColorHex #

TypeScript
getScanningIndicatorColorHex() => Promise<any>

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

Returns: Promise<any>

getScanningIndicatorWidth #

TypeScript
getScanningIndicatorWidth() => Promise<any>

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

Returns: Promise<any>

getScanningIndicatorAnimation #

TypeScript
getScanningIndicatorAnimation() => Promise<any>

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

Returns: Promise<any>

isScanningIndicatorAlwaysVisible #

TypeScript
isScanningIndicatorAlwaysVisible() => Promise<any>

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

Returns: Promise<any>

BarkoderRoiCenterMark #

Values for setRoiCenterMark(...) and the roiCenterMark configuration property.

MemberValue
none0
crosshair1
point2

AR mode #

setARMode #

TypeScript
setARMode(options: { value: BarkoderARMode; }) => Promise<any>

Sets the AR mode used for barcode scanning visualization (e.g., interactive, non-interactive, match filter or off).

ParamType
options{ value: BarkoderARMode; }

Returns: Promise<any>

setARReturnOnlyMatchedResults #

TypeScript
setARReturnOnlyMatchedResults(options: { value: boolean; }) => Promise

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 arMode == matchFilter and a match filter is active.

ParamType
options{ value: boolean; }

Returns: Promise<any>

setARDisplayOnlyMatchedResults #

TypeScript
setARDisplayOnlyMatchedResults(options: { value: boolean; }) => Promise

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 arMode == matchFilter and a match filter is active.

ParamType
options{ value: boolean; }

Returns: Promise<any>

setARResultDisappearanceDelayMs #

TypeScript
setARResultDisappearanceDelayMs(options: { value: number; }) => Promise<any>

Sets the delay (in milliseconds) after which a detected AR result is considered expired and removed.

ParamType
options{ value: number; }

Returns: Promise<any>

setARLocationTransitionSpeed #

TypeScript
setARLocationTransitionSpeed(options: { value: number; }) => Promise<any>

Sets the speed at which barcode location overlays transition positions.

ParamType
options{ value: number; }

Returns: Promise<any>

setAROverlayRefresh #

TypeScript
setAROverlayRefresh(options: { value: BarkoderAROverlayRefresh; }) => Promise<any>

Sets the refresh mode for the AR overlay on the camera preview.

ParamType
options{ value: BarkoderAROverlayRefresh; }

Returns: Promise<any>

setARSelectedLocationColor #

TypeScript
setARSelectedLocationColor(options: { value: string; }) => Promise<any>

Sets the color used for drawing the overlay around selected barcodes in AR mode.

ParamType
options{ value: string; }

Returns: Promise<any>

setARNonSelectedLocationColor #

TypeScript
setARNonSelectedLocationColor(options: { value: string; }) => Promise<any>

Sets the color used for drawing the overlay around non-selected barcodes in AR mode.

ParamType
options{ value: string; }

Returns: Promise<any>

setARSelectedLocationLineWidth #

TypeScript
setARSelectedLocationLineWidth(options: { value: number; }) => Promise<any>

Sets the line width of the overlay for selected barcodes in AR mode.

ParamType
options{ value: number; }

Returns: Promise<any>

setARNonSelectedLocationLineWidth #

TypeScript
setARNonSelectedLocationLineWidth(options: { value: number; }) => Promise<any>

Sets the line width of the overlay for non-selected barcodes in AR mode.

ParamType
options{ value: number; }

Returns: Promise<any>

setARLocationType #

TypeScript
setARLocationType(options: { value: BarkoderARLocationType; }) => Promise<any>

Sets the style of location overlays drawn around detected barcodes (tight, bounding box, or none).

ParamType
options{ value: BarkoderARLocationType; }

Returns: Promise<any>

setARDoubleTapToFreezeEnabled #

TypeScript
setARDoubleTapToFreezeEnabled(options: { enabled: boolean; }) => Promise<any>

Enables or disables the ability to freeze/unfreeze scanning via a double-tap gesture in AR mode.

ParamType
options{ enabled: boolean; }

Returns: Promise<any>

setARImageResultEnabled #

TypeScript
setARImageResultEnabled(options: { enabled: boolean; }) => Promise<any>

Enables or disables the capturing and processing of image data when a barcode is selected for AR mode.

ParamType
options{ enabled: boolean; }

Returns: Promise<any>

setARBarcodeThumbnailOnResultEnabled #

TypeScript
setARBarcodeThumbnailOnResultEnabled(options: { enabled: boolean; }) => Promise<any>

Enables or disables the barcode thumbnail on result for AR mode.

ParamType
options{ enabled: boolean; }

Returns: Promise<any>

setARResultLimit #

TypeScript
setARResultLimit(options: { value: number; }) => Promise<any>

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

ParamType
options{ value: number; }

Returns: Promise<any>

setARContinueScanningOnLimit #

TypeScript
setARContinueScanningOnLimit(options: { value: boolean; }) => Promise<any>

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

ParamType
options{ value: boolean; }

Returns: Promise<any>

setAREmitResultsAtSessionEndOnly #

TypeScript
setAREmitResultsAtSessionEndOnly(options: { value: boolean; }) => Promise<any>

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

ParamType
options{ value: boolean; }

Returns: Promise<any>

setARHeaderHeight #

TypeScript
setARHeaderHeight(options: { value: number; }) => Promise<any>

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

ParamType
options{ value: number; }

Returns: Promise<any>

setARHeaderShowMode #

TypeScript
setARHeaderShowMode(options: { value: BarkoderARHeaderShowMode; }) => Promise<any>

Sets the condition under which the header text is shown above the barcode (always, on selected, or never).

ParamType
options{ value: BarkoderARHeaderShowMode; }

Returns: Promise<any>

setARHeaderMaxTextHeight #

TypeScript
setARHeaderMaxTextHeight(options: { value: number; }) => Promise<any>

Sets the maximum text height used for rendering AR header text above barcodes.

ParamType
options{ value: number; }

Returns: Promise<any>

setARHeaderMinTextHeight #

TypeScript
setARHeaderMinTextHeight(options: { value: number; }) => Promise<any>

Sets the minimum text height used for rendering AR header text above barcodes.

ParamType
options{ value: number; }

Returns: Promise<any>

setARHeaderTextColorSelected #

TypeScript
setARHeaderTextColorSelected(options: { value: string; }) => Promise<any>

Sets the text color of the header when the barcode is in a selected state.

ParamType
options{ value: string; }

Returns: Promise<any>

setARHeaderTextColorNonSelected #

TypeScript
setARHeaderTextColorNonSelected(options: { value: string; }) => Promise<any>

Sets the text color of the header when the barcode is not selected.

ParamType
options{ value: string; }

Returns: Promise<any>

setARHeaderHorizontalTextMargin #

TypeScript
setARHeaderHorizontalTextMargin(options: { value: number; }) => Promise<any>

Sets the horizontal margin applied to the header text in AR mode, creating equal padding on both sides.

ParamType
options{ value: number; }

Returns: Promise<any>

setARHeaderVerticalTextMargin #

TypeScript
setARHeaderVerticalTextMargin(options: { value: number; }) => Promise<any>

Sets the vertical margin applied to the header text in AR mode, creating equal padding on both sides.

ParamType
options{ value: number; }

Returns: Promise<any>

setARHeaderTextFormat #

TypeScript
setARHeaderTextFormat(options: { value: string; }) => Promise<any>

Sets the format string for the AR header text above each barcode, using placeholders like \[barcode\_text\], \[barcode\_type\].

ParamType
options{ value: string; }

Returns: Promise<any>

resetARCache #

TypeScript
resetARCache() => Promise

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

Returns: Promise<any>

getARMode #

TypeScript
getARMode() => Promise<any>

Retrieves the current AR mode used for barcode scanning.

Returns: Promise<any>

getARReturnOnlyMatchedResults #

TypeScript
getARReturnOnlyMatchedResults() => Promise

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

Returns: Promise<any>

getARDisplayOnlyMatchedResults #

TypeScript
getARDisplayOnlyMatchedResults() => Promise

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

Returns: Promise<any>

getARResultDisappearanceDelayMs #

TypeScript
getARResultDisappearanceDelayMs() => Promise<any>

Retrieves the delay (in milliseconds) after which AR results disappear once detected.

Returns: Promise<any>

getARLocationTransitionSpeed #

TypeScript
getARLocationTransitionSpeed() => Promise<any>

Retrieves the transition speed for moving AR barcode locations on the screen.

Returns: Promise<any>

getAROverlayRefresh #

TypeScript
getAROverlayRefresh() => Promise<any>

Retrieves the current AR overlay refresh mode.

Returns: Promise<any>

getARSelectedLocationColor #

TypeScript
getARSelectedLocationColor() => Promise<any>

Retrieves the color used to highlight selected barcode locations in AR mode.

Returns: Promise<any>

getARNonSelectedLocationColor #

TypeScript
getARNonSelectedLocationColor() => Promise<any>

Retrieves the color used to highlight non-selected barcode locations in AR mode.

Returns: Promise<any>

getARSelectedLocationLineWidth #

TypeScript
getARSelectedLocationLineWidth() => Promise<any>

Retrieves the line width used for selected barcode locations in AR mode.

Returns: Promise<any>

getARNonSelectedLocationLineWidth #

TypeScript
getARNonSelectedLocationLineWidth() => Promise<any>

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

Returns: Promise<any>

getARLocationType #

TypeScript
getARLocationType() => Promise<any>

Retrieves the location type style used for drawing AR overlays (tight, bounding box, or none).

Returns: Promise<any>

isARDoubleTapToFreezeEnabled #

TypeScript
isARDoubleTapToFreezeEnabled() => Promise<any>

Checks if the double-tap-to-freeze feature is enabled in AR mode.

Returns: Promise<any>

isARImageResultEnabled #

TypeScript
isARImageResultEnabled() => Promise<any>

Retrieves whether image result is enabled for AR mode.

Returns: Promise<any>

isARBarcodeThumbnailOnResultEnabled #

TypeScript
isARBarcodeThumbnailOnResultEnabled() => Promise<any>

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

Returns: Promise<any>

getARResultLimit #

TypeScript
getARResultLimit() => Promise<any>

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

Returns: Promise<any>

getARContinueScanningOnLimit #

TypeScript
getARContinueScanningOnLimit() => Promise<any>

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

Returns: Promise<any>

getAREmitResultsAtSessionEndOnly #

TypeScript
getAREmitResultsAtSessionEndOnly() => Promise<any>

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

Returns: Promise<any>

getARHeaderHeight #

TypeScript
getARHeaderHeight() => Promise<any>

Retrieves the height of the header text shown above barcodes in AR mode.

Returns: Promise<any>

getARHeaderShowMode #

TypeScript
getARHeaderShowMode() => Promise<any>

Retrieves the display mode for AR header text (always, on selected, or never).

Returns: Promise<any>

getARHeaderMaxTextHeight #

TypeScript
getARHeaderMaxTextHeight() => Promise<any>

Retrieves the maximum height for AR header text.

Returns: Promise<any>

getARHeaderMinTextHeight #

TypeScript
getARHeaderMinTextHeight() => Promise<any>

Retrieves the minimum height for AR header text.

Returns: Promise<any>

getARHeaderTextColorSelected #

TypeScript
getARHeaderTextColorSelected() => Promise<any>

Retrieves the color used for header text when a barcode is selected in AR mode.

Returns: Promise<any>

getARHeaderTextColorNonSelected #

TypeScript
getARHeaderTextColorNonSelected() => Promise<any>

Retrieves the color used for header text when a barcode is not selected in AR mode.

Returns: Promise<any>

getARHeaderHorizontalTextMargin #

TypeScript
getARHeaderHorizontalTextMargin() => Promise<any>

Retrieves the horizontal margin applied to the AR header text.

Returns: Promise<any>

getARHeaderVerticalTextMargin #

TypeScript
getARHeaderVerticalTextMargin() => Promise<any>

Retrieves the vertical margin applied to the AR header text.

Returns: Promise<any>

getARHeaderTextFormat #

TypeScript
getARHeaderTextFormat() => Promise<any>

Retrieves the format string used for rendering AR header text above barcodes.

Returns: Promise<any>

BarkoderARMode #

Values for setARMode(...) and the arMode AR configuration property.

MemberValue
off0
interactiveDisabled1
interactiveEnabled2
nonInteractive3
matchFilter4

BarkoderAROverlayRefresh #

Values for setAROverlayRefresh(...) and the overlayRefresh AR configuration property.

MemberValue
smooth0
normal1

BarkoderARLocationType #

Values for setARLocationType(...) and the locationType AR configuration property.

MemberValue
none0
tight1
boundingBox2

BarkoderARHeaderShowMode #

Values for setARHeaderShowMode(...) and the headerShowMode AR configuration property.

MemberValue
never0
always1
onSelected2

Example:

TypeScript
import { Barkoder, BarkoderARHeaderShowMode } from 'barkoder-capacitor';

Barkoder.setARHeaderShowMode({
  value: BarkoderARHeaderShowMode.onSelected,
});

On-screen buttons #

configureCloseButton #

TypeScript
configureCloseButton(options: { visible: boolean; positionX: number; positionY: number; iconSize: number; tintColor: string; backgroundColor: string; cornerRadius: number; padding: number; useCustomIcon: boolean; customIcon: string; }) => Promise<any>

Configures the close button displayed during scanning.

To perform an action when the button is tapped, listen for the barkoderCloseButtonTappedEvent

visible - Show the button while scanning. positionX - X position in points. positionY - Y position in points. iconSize - Glyph point size. tintColor - Icon tint. Hex string (e.g., "#3472c9"); leave "" to use the default. backgroundColor - Button background. Hex string; default is clear. Leave "" to use the default. cornerRadius - Corner radius. padding - Inner padding around the glyph. useCustomIcon - Set true to use a provided custom icon. customIcon - Custom icon as a Base64-encoded image string.

ParamType
options{ visible: boolean; positionX: number; positionY: number; iconSize: number; tintColor: string; backgroundColor: string; cornerRadius: number; padding: number; useCustomIcon: boolean; customIcon: string; }

Returns: Promise<any>

configureFlashButton #

TypeScript
configureFlashButton(options: { visible: boolean; positionX: number; positionY: number; iconSize: number; tintColor: string; backgroundColor: string; cornerRadius: number; padding: number; useCustomIcon: boolean; customIconFlashOn: string; customIconFlashOff: string; }) => Promise<any>

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

visible - Show the button while scanning. positionX - X position in points. positionY - Y position in points. iconSize - Glyph point size. tintColor - Icon tint. Hex string (e.g., "#3472c9"); leave "" to use the default. backgroundColor - Button background. Hex string; default is clear. Leave "" to use the default. cornerRadius - Corner radius. padding - Inner padding around the glyph. useCustomIcon - Set true to use provided custom icons. customIconFlashOn - Custom ON-state icon as a Base64-encoded image string. customIconFlashOff - Custom OFF-state icon as a Base64-encoded image string.

ParamType
options{ visible: boolean; positionX: number; positionY: number; iconSize: number; tintColor: string; backgroundColor: string; cornerRadius: number; padding: number; useCustomIcon: boolean; customIconFlashOn: string; customIconFlashOff: string; }

Returns: Promise<any>

configureZoomButton #

TypeScript
configureZoomButton(options: { 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; }) => Promise<any>

Configures the zoom button displayed during scanning.

visible - Show the button while scanning. positionX - X position in points. positionY - Y position in points. iconSize - Glyph point size. tintColor - Icon tint. Hex string (e.g., "#3472c9"); leave "" to use the default. backgroundColor - Button background. Hex string; default is clear. Leave "" to use the default. cornerRadius - Corner radius. padding - Inner padding around the glyph. useCustomIcon - Set true to use provided custom icons. customIconZoomedIn - Custom icon for the zoomed-in state as a Base64-encoded image string. customIconZoomedOut - Custom icon for the zoomed-out state as a Base64-encoded image string. zoomedInFactor - Zoom factor when toggled in. zoomedOutFactor - Zoom factor when toggled out.

ParamType
options{ 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; }

Returns: Promise<any>

barkoderCloseButtonTappedEvent #

Emitted when the user taps the button configured with configureCloseButton(...). The event has no custom payload. Register a listener to handle the tap.

TypeScript
import { Barkoder } from 'barkoder-capacitor';

const closeButtonListener = Barkoder.addListener('barkoderCloseButtonTappedEvent', () => {
  console.log('barkoderCloseButtonTappedEvent was fired');
});

In Angular, inject NgZone and wrap changes to template-bound state inside this.ngZone.run(() => { ... }) in the callback. This applies to both the close-button and scan-result listeners.

When disposing the view, remove this subscription with closeButtonListener.then(handle => handle.remove()). The variable holds the promise returned by addListener(...), not the resolved listener handle.