Barcode AR AIO View
Defined under the namespace Scandit.Datacapture.Barcode.Ar.Ui
- BarcodeArAioView
class BarcodeArAioViewAdded in version 8.7.0
An all-in-one React component for MatrixScan AR. Rendering this single element replaces the manual assembly of a DataCaptureContext, a BarcodeAr mode and a BarcodeArView — the component owns all of them, along with its camera claim and its lifecycle.
The component must be rendered inside a ScanditProvider, which supplies the DataCaptureContext and the shared camera. Scanning starts once the component is mounted and enabled, and stops when it unmounts.
Configuration is passed through BarcodeArAioViewProps. To gain manual control over the component, attach a React
reftyped as BarcodeArAioViewHandle.To build your first screen with the AIO components, refer to the AIO components getting started guide. For the classic API, refer to the MatrixScan AR Get Started guide.
- BarcodeArAioViewProps
interface BarcodeArAioViewPropsAdded in version 8.7.0
Configuration for BarcodeArAioView.
A settings source is required: pass either symbologies or settings. Both are optional on this interface, but BarcodeArAioView requires one of them, so rendering the component with neither is a compile error. Supplying both is allowed, and settings takes precedence. Every other prop is optional.
- didScan(barcodes, session, getFrameData)
didScan?(barcodes: TrackedBarcode[], session: BarcodeArSession, getFrameData: () => Promise<FrameData>):
void| Promise<void>Added in version 8.7.0
Called on each session update with every newly-added tracked barcode. Each entry is a TrackedBarcode, taken from BarcodeArSession.addedTrackedBarcodes.
Derived from the same native BarcodeArListener.didUpdateSession() event as didUpdateSession(). When both are set,
didUpdateSessioncompletes first and thendidScanfires, skipped when nothing was added.getFrameData()resolves to the FrameData for the frame and stays valid across both.
- didUpdateSession(session, getFrameData)
didUpdateSession?(session: BarcodeArSession, getFrameData: () => Promise<FrameData>):
void| Promise<void>Added in version 8.7.0
Called on every session update, before didScan() for the same update. Backed by the native BarcodeArListener.didUpdateSession() event.
- symbologies
symbologies?: Symbology[]
Added in version 8.7.0
Symbologies to enable. Shorthand for BarcodeArSettings.enabledSymbologies; ignored when settings is set.
- settings
settings?: BarcodeArSettings |
nullAdded in version 8.7.0
The settings applied to the underlying mode, as a complete BarcodeArSettings object. Takes precedence over symbologies; when both are given, the shorthand is ignored and a warning is logged.
- viewSettings
viewSettings?: BarcodeArViewSettings |
nullAdded in version 8.7.0
View-level settings, as a BarcodeArViewSettings object.
- cameraSettings
cameraSettings?: CameraSettings |
nullAdded in version 8.7.0
Camera settings for the view’s own camera. Omit to use BarcodeAr.createRecommendedCameraSettings().
- highlightProvider
highlightProvider?: BarcodeArHighlightProvider |
nullAdded in version 8.7.0
Provider that supplies highlight information for barcodes in the view. If null, a default provider is used, which returns a predefined highlight for each barcode.
- annotationProvider
annotationProvider?: BarcodeArAnnotationProvider |
nullAdded in version 8.7.0
Provider that supplies annotation information for barcodes in the view. If null, no annotation is displayed for any barcode.
- uiListener
uiListener?: BarcodeArViewUiListener |
nullAdded in version 8.7.0
Listener called whenever a barcode highlight is tapped in the view.
- barcodeFilter
barcodeFilter?: BarcodeArFilter |
nullAdded in version 8.7.0
Filter that determines which barcodes are visible in the BarcodeArSession. Pass null to remove the filter and show all barcodes. See BarcodeArFilter for details on implementing a custom filter.
- feedback
feedback?: BarcodeArFeedback
Added in version 8.7.0
Sound and vibration feedback emitted on scan, as a BarcodeArFeedback. Omit to use the SDK default, which enables both sound (a beep) and vibration.
- shouldShowTorchControl
shouldShowTorchControl?: boolean
Added in version 8.7.0
Whether the torch control button is shown. Defaults to false.
- torchControlPosition
torchControlPosition?: Anchor
Added in version 8.7.0
Position of the torch control button. Defaults to Anchor.TopLeft.
- shouldShowZoomControl
shouldShowZoomControl?: boolean
Added in version 8.7.0
Whether the zoom control button is shown.
- zoomControlPosition
zoomControlPosition?: Anchor
Added in version 8.7.0
Position of the zoom control button. Defaults to Anchor.BottomRight.
- shouldShowCameraSwitchControl
shouldShowCameraSwitchControl?: boolean
Added in version 8.7.0
Whether the camera switch control button is shown.
- cameraSwitchControlPosition
cameraSwitchControlPosition?: Anchor
Added in version 8.7.0
Position of the camera switch control button. Defaults to Anchor.TopRight.
- shouldShowMacroModeControl
shouldShowMacroModeControl?: boolean
Added in version 8.7.0
Whether the macro mode control button is shown.
- macroModeControlPosition
macroModeControlPosition?: Anchor
Added in version 8.7.0
Position of the macro mode control button. Defaults to Anchor.TopRight.
navigation?: ScanditNavigationProp
Added in version 8.7.0
Navigation object for the screen the component is rendered on, for example React Navigation’s
navigationprop (typed as ScanditNavigationProp). When it is provided, scanning is suspended — the mode is disabled and the camera turned off — while the screen is blurred or the application is backgrounded, and resumed when the screen regains focus. Ignored while disabled is set.
- disabled
disabled?: boolean
Added in version 8.7.0
Set to true to keep scanning off. Leaving it false does not keep scanning on — navigation and app-state handling still turn the mode on and off on their own.
BarcodeArAioViewHandle.enable() and BarcodeArAioViewHandle.disable() change the same state directly. If you call those, this prop no longer reflects whether the component is actually scanning.
- appStateHandlingDisabled
appStateHandlingDisabled?: boolean
Added in version 8.7.0
Turns off the automatic enabling and disabling of the mode in response to the application moving between foreground and background.
- BarcodeArAioViewHandle
interface BarcodeArAioViewHandleAdded in version 8.7.0
Imperative operations on a BarcodeArAioView, reached through a
refon the component.- reset()
reset(): Promise<
void>Added in version 8.7.0
Removes all current highlights and annotations.