Label Capture AIO View
Defined under the namespace Scandit.Datacapture.Label
- LabelCaptureAioView
class LabelCaptureAioViewAdded in version 8.7.0
An all-in-one React component for capturing labels. Rendering this single element replaces the manual assembly of a DataCaptureContext, a LabelCapture mode, a DataCaptureView and its overlays — 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 LabelCaptureAioViewProps. To gain manual control over the component, attach a React
reftyped as LabelCaptureAioViewHandle.
- LabelCaptureAioViewProps
interface LabelCaptureAioViewPropsAdded in version 8.7.0
Configuration for LabelCaptureAioView.
A settings source is required: pass either labelDefinitions or labelCaptureSettings. Both are optional on this interface, but LabelCaptureAioView requires one of them, so rendering the component with neither is a compile error — nothing is captured without a label definition. Supplying both is allowed, and settings wins with a warning.
- style
style?: StyleProp<ViewStyle>
Added in version 8.7.0
Style applied to the view, defaulting to
{ flex: 1 }. This is the only React NativeViewprop the component forwards — it renders its own DataCaptureView and passes nothing else through.
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.
LabelCaptureAioViewHandle.enable() and LabelCaptureAioViewHandle.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.
- labelDefinitions
labelDefinitions?: LabelDefinition[]
Added in version 8.7.0
The label definitions to capture. Required unless labelCaptureSettings is supplied instead. Ignored when both are given, in which case a warning is logged.
- labelCaptureSettings
labelCaptureSettings?: LabelCaptureSettings |
nullAdded in version 8.7.0
The settings applied to the underlying LabelCapture mode. Required unless labelDefinitions is supplied instead. Takes precedence when both are given.
- didScan(labels, session, getFrameData)
didScan?(labels: CapturedLabel[], session: LabelCaptureSession, getFrameData: () => Promise<FrameData |
null>):void| Promise<void>Added in version 8.7.0
Convenience callback fired with the labels newly captured in a session update. Derived from the same native event as didUpdateSession(): when both are set, didUpdateSession() completes first and then this callback fires, and it is skipped entirely when the update captured nothing.
getFrameDatastays valid across both callbacks.
- didUpdateSession(session, getFrameData)
didUpdateSession?(session: LabelCaptureSession, getFrameData: () => Promise<FrameData |
null>):void| Promise<void>Added in version 8.7.0
Fires on every session update, before didScan() for the same update.
- basicOverlay
basicOverlay?: LabelCaptureAioBasicOverlayProps
Added in version 8.7.0
Configuration for the basic overlay, described by LabelCaptureAioBasicOverlayProps. The overlay is attached by default, so omitting this prop yields the default overlay. To skip it entirely:
<LabelCaptureAioView labelDefinitions={definitions} basicOverlay={{ enabled: false }} />
- advancedOverlay
advancedOverlay?: LabelCaptureAioAdvancedOverlayProps
Added in version 8.7.0
Configuration for the advanced overlay, which renders custom views per captured label or field. Omit the prop entirely to skip the overlay; pass any object — even
{}— to opt in. See LabelCaptureAioAdvancedOverlayProps.Mutually exclusive with validationFlowOverlay and adaptiveRecognitionOverlay. When more than one is supplied, adaptive recognition wins over the validation flow, which wins over the advanced overlay; the overlays that lose are not attached and a warning is logged.
- validationFlowOverlay
validationFlowOverlay?: LabelCaptureAioValidationFlowOverlayProps
Added in version 8.7.0
Configuration for the validation-flow overlay. Omit the prop entirely to skip the overlay; pass any object — even
{}— to opt in. Mutually exclusive with advancedOverlay and adaptiveRecognitionOverlay. See LabelCaptureAioValidationFlowOverlayProps.
- adaptiveRecognitionOverlay
adaptiveRecognitionOverlay?: LabelCaptureAioAdaptiveRecognitionOverlayProps
Added in version 8.7.0
Configuration for the adaptive-recognition (receipt-scanning) overlay. Omit the prop entirely to skip the overlay; pass any object — even
{}— to opt in. Mutually exclusive with advancedOverlay and validationFlowOverlay, and takes precedence over both. See LabelCaptureAioAdaptiveRecognitionOverlayProps.
- feedback
feedback?: LabelCaptureFeedback
Added in version 8.7.0
Sound and vibration feedback emitted on capture. Omit to use the SDK default.
- LabelCaptureAioBasicOverlayProps
interface LabelCaptureAioBasicOverlayPropsAdded in version 8.7.0
Configuration for the LabelCaptureBasicOverlay that LabelCaptureAioView attaches by default. Every member is optional.
- enabled
enabled?: boolean
Added in version 8.7.0
Whether to attach the basic overlay at all. Defaults to true; pass false to render the camera preview without it.
- labelBrush
labelBrush?: Brush |
nullAdded in version 8.7.0
Default brush applied to every captured label.
- capturedFieldBrush
capturedFieldBrush?: Brush |
nullAdded in version 8.7.0
Brush applied to captured — that is, confirmed — fields.
- predictedFieldBrush
predictedFieldBrush?: Brush |
nullAdded in version 8.7.0
Brush applied to predicted fields.
- shouldShowScanAreaGuides
shouldShowScanAreaGuides?: boolean
Added in version 8.7.0
Whether the overlay renders scan-area guides.
- viewfinder
viewfinder?: Viewfinder |
nullAdded in version 8.7.0
The viewfinder drawn by the basic overlay.
- brushForLabel(label)
brushForLabel?(label: CapturedLabel): Brush |
nullAdded in version 8.7.0
Per-label brush override. Return null to fall back to labelBrush.
- brushForFieldOfLabel(field, label)
brushForFieldOfLabel?(field: LabelField, label: CapturedLabel): Brush |
nullAdded in version 8.7.0
Per-field brush override. Return null to fall back to the captured- or predicted-field brush.
- didTapLabel(label)
didTapLabel?(label: CapturedLabel):
voidAdded in version 8.7.0
Called when the user taps a captured label.
- LabelCaptureAioBasicOverlayHandle
interface LabelCaptureAioBasicOverlayHandleAdded in version 8.7.0
Imperative operations scoped to the basic overlay, reached through LabelCaptureAioViewHandle.basicOverlay. Present only while the basic overlay is enabled.
- setBrushForLabel(brush, label)
setBrushForLabel(brush: Brush, label: CapturedLabel): Promise<
void>Added in version 8.7.0
Overrides the brush used for a captured label.
- setBrushForFieldOfLabel(brush, field, label)
setBrushForFieldOfLabel(brush: Brush, field: LabelField, label: CapturedLabel): Promise<
void>Added in version 8.7.0
Overrides the brush used for a field of a captured label.
- LabelCaptureAioAdvancedOverlayProps
interface LabelCaptureAioAdvancedOverlayPropsAdded in version 8.7.0
Configuration for the LabelCaptureAdvancedOverlay, which renders application-supplied views per captured label or field. The overlay is attached only when this prop is supplied; pass
{ enabled: false }to keep the prop shape while disabling the overlay at runtime.- enabled
enabled?: boolean
Added in version 8.7.0
Whether to attach the advanced overlay. Defaults to true when the prop is supplied.
- shouldShowScanAreaGuides
shouldShowScanAreaGuides?: boolean
Added in version 8.7.0
Whether the overlay renders scan-area guides.
- viewForCapturedLabel(label)
viewForCapturedLabel?(label: CapturedLabel): LabelCaptureAdvancedOverlayView |
nullAdded in version 8.7.0
Returns the view to draw for a captured label, or null to draw nothing.
- anchorForCapturedLabel(label)
anchorForCapturedLabel?(label: CapturedLabel): Anchor
Added in version 8.7.0
Returns the anchor point of the view drawn for a captured label.
- offsetForCapturedLabel(label)
offsetForCapturedLabel?(label: CapturedLabel): PointWithUnit
Added in version 8.7.0
Returns the offset applied to the view drawn for a captured label.
- viewForCapturedLabelField(field)
viewForCapturedLabelField?(field: LabelField): LabelCaptureAdvancedOverlayView |
nullAdded in version 8.7.0
Returns the view to draw for a captured label field, or null to draw nothing.
- anchorForCapturedLabelField(field)
anchorForCapturedLabelField?(field: LabelField): Anchor
Added in version 8.7.0
Returns the anchor point of the view drawn for a captured label field.
- offsetForCapturedLabelField(field)
offsetForCapturedLabelField?(field: LabelField): PointWithUnit
Added in version 8.7.0
Returns the offset applied to the view drawn for a captured label field.
- LabelCaptureAioAdvancedOverlayHandle
interface LabelCaptureAioAdvancedOverlayHandleAdded in version 8.7.0
Imperative operations scoped to the advanced overlay, reached through LabelCaptureAioViewHandle.advancedOverlay. Present only while the advanced overlay is supplied and enabled.
- setViewForCapturedLabel(label, view)
setViewForCapturedLabel(label: CapturedLabel, view: LabelCaptureAdvancedOverlayView |
null): Promise<void>Added in version 8.7.0
Sets the view drawn for a captured label, taking precedence over LabelCaptureAioAdvancedOverlayProps.viewForCapturedLabel().
- setAnchorForCapturedLabel(label, anchor)
setAnchorForCapturedLabel(label: CapturedLabel, anchor: Anchor): Promise<
void>Added in version 8.7.0
Sets the anchor point of the view drawn for a captured label.
- setOffsetForCapturedLabel(label, offset)
setOffsetForCapturedLabel(label: CapturedLabel, offset: PointWithUnit): Promise<
void>Added in version 8.7.0
Sets the offset applied to the view drawn for a captured label.
- setViewForCapturedLabelField(field, label, view)
setViewForCapturedLabelField(field: LabelField, label: CapturedLabel, view: LabelCaptureAdvancedOverlayView |
null): Promise<void>Added in version 8.7.0
Sets the view drawn for a field of a captured label.
- setAnchorForCapturedLabelField(field, label, anchor)
setAnchorForCapturedLabelField(field: LabelField, label: CapturedLabel, anchor: Anchor): Promise<
void>Added in version 8.7.0
Sets the anchor point of the view drawn for a field of a captured label.
- setOffsetForCapturedLabelField(field, label, offset)
setOffsetForCapturedLabelField(field: LabelField, label: CapturedLabel, offset: PointWithUnit): Promise<
void>Added in version 8.7.0
Sets the offset applied to the view drawn for a field of a captured label.
- LabelCaptureAioValidationFlowOverlayProps
interface LabelCaptureAioValidationFlowOverlayPropsAdded in version 8.7.0
Configuration for the LabelCaptureValidationFlowOverlay. The overlay is attached only when this prop is supplied; pass
{ enabled: false }to opt out at runtime.- enabled
enabled?: boolean
Added in version 8.7.0
Whether to attach the validation-flow overlay. Defaults to true when the prop is supplied.
- settings
settings?: LabelCaptureValidationFlowSettings |
nullAdded in version 8.7.0
Settings applied to the validation-flow overlay.
- shouldHandleKeyboardInsetsInternally
shouldHandleKeyboardInsetsInternally?: boolean
Added in version 8.7.0
Whether the overlay adjusts its own layout for the on-screen keyboard. Turn this off to handle keyboard insets in the application instead.
- didCaptureLabelWithFields(fields)
didCaptureLabelWithFields?(fields: LabelField[]):
voidAdded in version 8.7.0
Called when the validation flow completes with the given fields.
- didSubmitManualInputForField(field, oldValue, newValue)
didSubmitManualInputForField?(field: LabelField, oldValue: string |
null, newValue: string):voidAdded in version 8.7.0
Called when the user manually edits a field’s value in the validation flow, with the previous and the newly-submitted value.
- didUpdateValidationFlowResult(type, asyncId, fields, getFrameData)
didUpdateValidationFlowResult?(type: LabelResultUpdateType, asyncId: number, fields: LabelField[], getFrameData: () => Promise<FrameData |
null>): Promise<void>Added in version 8.7.0
Called whenever the validation flow’s result changes. Receives four arguments: a LabelResultUpdateType describing the change, an async id, the LabelField values the update applies to, and a
getFrameDatafunction resolving to the FrameData for the frame.
- LabelCaptureAioValidationFlowOverlayHandle
interface LabelCaptureAioValidationFlowOverlayHandleAdded in version 8.7.0
Imperative operations scoped to the validation-flow overlay, reached through LabelCaptureAioViewHandle.validationFlowOverlay. Present only while the validation-flow overlay is supplied and enabled.
- applySettings(settings)
applySettings(settings: LabelCaptureValidationFlowSettings): Promise<
void>Added in version 8.7.0
Applies new settings to the validation-flow overlay.
- LabelCaptureAioAdaptiveRecognitionOverlayProps
interface LabelCaptureAioAdaptiveRecognitionOverlayPropsAdded in version 8.7.0
Configuration for the LabelCaptureAdaptiveRecognitionOverlay, used for receipt scanning. The overlay is attached only when this prop is supplied; pass
{ enabled: false }to opt out at runtime.- enabled
enabled?: boolean
Added in version 8.7.0
Whether to attach the adaptive-recognition overlay. Defaults to true when the prop is supplied.
- settings
settings?: LabelCaptureAdaptiveRecognitionSettings |
nullAdded in version 8.7.0
Settings applied to the adaptive-recognition overlay.
- didRecognize(result)
didRecognize?(result: AdaptiveRecognitionResult):
voidAdded in version 8.7.0
Called when adaptive recognition produces a result.
- didFail()
didFail?():
voidAdded in version 8.7.0
Called when adaptive recognition fails to produce a result.
- LabelCaptureAioViewHandle
interface LabelCaptureAioViewHandleAdded in version 8.7.0
Imperative operations on a LabelCaptureAioView, reached through a
refon the component.Overlay-scoped operations live under the namespaces below, each present only when its overlay is configured and enabled — so a method can never be called on an overlay that is not there.
- reset()
reset(): Promise<
void>Added in version 8.7.0
Present for parity with the other AIO view handles.
Note
LabelCapture exposes no reset operation on the shared API, so this method currently does nothing. Do not rely on it to discard captured labels.
- enable()
enable(): Promise<
void>Added in version 8.7.0
Turns scanning on now: enables the mode and turns the camera on. Automatic navigation and application-state handling may subsequently turn it off again.
- disable()
disable(): Promise<
void>Added in version 8.7.0
Turns scanning off now: disables the mode and turns the camera off.
- basicOverlay
basicOverlay?: LabelCaptureAioBasicOverlayHandle
Added in version 8.7.0
Operations on the basic overlay. Omitted when the basic overlay is disabled.
- advancedOverlay
advancedOverlay?: LabelCaptureAioAdvancedOverlayHandle
Added in version 8.7.0
Operations on the advanced overlay. Omitted when the advanced overlay is not supplied or is disabled.
- validationFlowOverlay
validationFlowOverlay?: LabelCaptureAioValidationFlowOverlayHandle
Added in version 8.7.0
Operations on the validation-flow overlay. Omitted when the validation-flow overlay is not supplied or is disabled.