Skip to main content
Speed up SparkScan integration with Agent Skills

Install the Scandit plugin and use the /sparkscan-capacitor skill so that your AI coding agent can integrate, debug, and customize SparkScan on Capacitor following Scandit's recommended patterns. More info →

Run the following command in your project directory. It detects the supported coding agents you have installed and adds the Scandit plugin to each. Re-run it to update.

npx plugins add scandit/skills

Prefer to set it up yourself? Manual installation steps for each agent →

SparkScan settings reference

This page lists the SparkScan settings and view properties on Capacitor, with their defaults and allowed values as the API reference states them. A blank default means the API reference states none. For what the workflow settings do for your users, see How SparkScan works.

Options​

SparkScanSettings​

SparkScanSettings holds the scanning settings, such as the enabled symbologies. To change them on a running scanner, pass them to SparkScan.applySettings().

NameTypeDefaultValuesWhat it does
constructor(capturePresets)ConstructorSet<CapturePreset>, optionalCreates settings. Presets enable the matching symbologies and optimizations. Added in 8.3.0.
codeDuplicateFilternumber-2-2: depends on scanIntention. -1: not reported again until scanning stops. 0: no filtering. Greater than 0: time before the same code is reported again.Filters out codes with the same symbology and data that are scanned again within the interval. If you keep the default and turn the selection mode On, SparkScan doesn't filter duplicates, so users can select the same barcode again.
enabledSymbologiesSymbology[]Empty: all symbologies are disabledRead-only. The enabled symbologies.
enableSymbology(symbology, enabled)MethodEnables or disables one symbology.
enableSymbologies(symbologies)MethodEnables a list of symbologies.
settingsForSymbology(symbology)MethodReturns the SymbologySettings of one symbology, for example to change its active symbol counts.
enabledCompositeTypesCompositeType[]The composite code types to scan. Added in 8.3.0.
enableSymbologiesForCompositeTypes(compositeTypes)MethodEnables the symbologies that the given composite types need. Added in 8.3.0.
batterySavingBatterySavingModeBatterySavingMode.AutoBatterySavingMode.On, BatterySavingMode.Off, BatterySavingMode.AutoThe battery saving mode. BatterySavingMode.Auto turns it on when battery use is higher than usual.
scanIntentionScanIntentionScanIntention.SmartScanIntention.Smart, ScanIntention.ManualWhether SparkScan identifies the barcode the user intends to scan. It has no effect while selectionMode is SelectionMode.On.
selectionModeSelectionModeSelectionMode.AutoSelectionMode.Auto, SelectionMode.On, SelectionMode.OffWhether users confirm the aimed barcode with the trigger button. Added in 8.5.0.
itemDefinitionsScanItemDefinition[] | nullConfigures the settings with the item-based scanning API. When set, enabledSymbologies is ignored. Beta. Added in 8.1.0.
setProperty(name, value)MethodSets a property that isn't part of the stable API yet.
getProperty(name)MethodReturns the value of a property set with setProperty().

SparkScanViewSettings​

SparkScanViewSettings sets the view's default look and behavior. Pass them when you create the SparkScanView. Changes after that don't apply to the view.

NameTypeDefaultValuesWhat it does
triggerButtonCollapseTimeoutnumber5 secondsA negative value means no timeout.Time after which the view switches to the idle state.
inactiveStateTimeoutnumber10 secondsTime after which the scanner stops capturing.
scanningBehaviorSparkScanScanningBehaviorSparkScanScanningBehavior.SingleSparkScanScanningBehavior.Single, SparkScanScanningBehavior.ContinuousWhether the view scans one barcode per trigger or keeps scanning. Added in 8.7.0.
previewBehaviorSparkScanPreviewBehaviorSparkScanPreviewBehavior.DefaultSparkScanPreviewBehavior.Default, SparkScanPreviewBehavior.PersistentWhether the preview hides after a scan or stays visible. Added in 8.7.0.
defaultTorchStateTorchStateTorchState.OffTorchState.On, TorchState.Off, TorchState.AutoThe torch state when the camera starts.
soundEnabledbooleantrueWhether the scan feedback plays a sound.
hapticEnabledbooleantrueWhether the scan feedback vibrates.
holdToScanEnabledbooleantrueWhether users can scan continuously by touching & holding the trigger button. Ignored while selectionMode is SelectionMode.On.
hardwareTriggerEnabledbooleanWhether a hardware button starts scanning.
hardwareTriggerKeyCodenumber | nullnull: the dedicated button on XCover devices, or volume down on other devicesThe key code of the hardware button that starts scanning. Applies on Android only.
visualFeedbackEnabledbooleantrueWhether the screen flashes after a scan.
toastSettingsSparkScanToastSettingsThe text and colors of the toast messages.
selectionModeCandidateBrushBrush | nullnull uses the default brush.The brush for candidate barcodes while selectionMode is SelectionMode.Auto. Added in 8.5.0.
zoomFactorOutnumber1The camera zoom factor.
zoomFactorInnumber2The zoom factor after users tap the zoom switch control.
defaultMiniPreviewSizeSparkScanMiniPreviewSizeSparkScanMiniPreviewSize.RegularSparkScanMiniPreviewSize.Regular, SparkScanMiniPreviewSize.ExpandedThe size of the mini preview.
defaultCameraPositionCameraPositionCameraPosition.WorldFacingCameraPosition.WorldFacing, CameraPosition.UserFacing, CameraPosition.UnspecifiedThe camera the view starts with. Beta.
periscopeModeEnabledbooleanfalseMirrors the camera feed for use with a periscope device. iOS only. Added in 8.3.0.

SparkScanView properties​

SparkScanView properties change the view after you create it.

NameTypeDefaultValuesWhat it does
feedbackDelegateSparkScanFeedbackDelegate | nullDecides the feedback for each scanned barcode. Without a delegate, SparkScan gives success feedback.
uiListenerSparkScanViewUiListener | nullReceives toolbar button taps and view state changes.
triggerButtonVisiblebooleantrueShows the trigger button.
zoomSwitchControlVisiblebooleantrueShows the zoom switch control. Added in 8.4.0.
previewSizeControlVisiblebooleantrueShows the mini preview size control.
torchControlVisiblebooleantrueShows the torch control.
previewCloseControlVisiblebooleantrueShows the mini preview close control.
selectionModeButtonVisiblebooleanfalseShows the toolbar button that switches selectionMode between SelectionMode.On and SelectionMode.Off. Added in 8.5.0.
scanningBehaviorButtonVisiblebooleanfalseShows the toolbar button for the scanning behavior.
barcodeCountButtonVisiblebooleanfalseShows the toolbar button for MatrixScan Count.
barcodeFindButtonVisiblebooleanfalseShows the toolbar button for MatrixScan Find.
labelCaptureButtonVisiblebooleanfalseShows the toolbar button for Smart Label Capture.
cameraSwitchButtonVisiblebooleanfalseShows the camera switch button. Beta.
triggerButtonCollapsedColorColor | nullThe trigger button's background color when collapsed.
triggerButtonExpandedColorColor | nullThe trigger button's background color when expanded.
triggerButtonAnimationColorColor | nullThe color of the pulsing animation around the trigger button while scanning.
triggerButtonTintColorColor | nullThe trigger button's tint color.
triggerButtonImagestring | nullThe image on the trigger button.
toolbarBackgroundColorColor | nullnullThe toolbar's background color.
toolbarIconActiveTintColorColor | nullnullThe color of active toolbar icons.
toolbarIconInactiveTintColorColor | nullnullThe color of inactive toolbar icons.
defaultBrushBrushRead-only static property. The default brush of the overlay.

Framework differences​

On Capacitor, these options differ from the other SparkScan frameworks:

Next step​

Choosing which barcode types to scan