ID Capture AIO View

Defined under the namespace Scandit.Datacapture.Id

IdCaptureAioView
class IdCaptureAioView

Added in version 8.7.0

An all-in-one React component for scanning personal identification documents. Rendering this single element replaces the manual assembly of a DataCaptureContext, an IdCapture mode, a DataCaptureView and an IdCaptureOverlay — the component owns all four, 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 IdCaptureAioViewProps. To gain manual control over the component, attach a React ref typed as IdCaptureAioViewHandle.

IdCaptureAioViewProps
interface IdCaptureAioViewProps

Added in version 8.7.0

Configuration for IdCaptureAioView. idCaptureSettings is required; every other member is optional.

style
style?: StyleProp<ViewStyle>

Added in version 8.7.0

Style applied to the view, defaulting to { flex: 1 }. This is the only React Native View prop the component forwards — it renders its own DataCaptureView and passes nothing else through.

navigation
navigation?: ScanditNavigationProp

Added in version 8.7.0

Navigation object for the screen the component is rendered on, for example React Navigation’s navigation prop (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.

IdCaptureAioViewHandle.enable() and IdCaptureAioViewHandle.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.

didCaptureId(capturedId)
didCaptureId?(capturedId: CapturedId): void

Added in version 8.7.0

Called whenever a document is recognized and parsed.

didRejectId(rejectedId, reason)
didRejectId?(rejectedId: CapturedId | null,
        reason: RejectionReason): void

Added in version 8.7.0

Called whenever a document or one of its parts is recognized in a frame but rejected, with the RejectionReason explaining why.

idCaptureSettings
idCaptureSettings: IdCaptureSettings

Added in version 8.7.0

The settings applied to the underlying IdCapture mode. Required — the default IdCaptureSettings accept no documents, so a view without explicit settings would never scan anything. Omitting it is a compile error.

basicOverlay
basicOverlay?: IdCaptureAioBasicOverlayProps

Added in version 8.7.0

Configuration for the basic overlay, described by IdCaptureAioBasicOverlayProps. The overlay is attached by default, so omitting this prop yields the default overlay. To skip it entirely:

<IdCaptureAioView
  idCaptureSettings={settings}
  basicOverlay={{ enabled: false }}
/>
torchSwitchControl
torchSwitchControl?: TorchSwitchControl | null

Added in version 8.7.0

Adds a torch toggle control drawn on top of the camera preview.

zoomSwitchControl
zoomSwitchControl?: ZoomSwitchControl | null

Added in version 8.7.0

Adds a zoom toggle control drawn on top of the camera preview.

feedback
feedback?: IdCaptureFeedback

Added in version 8.7.0

Sound and vibration feedback emitted on capture and rejection. Omit to use the SDK default.

IdCaptureAioBasicOverlayProps
interface IdCaptureAioBasicOverlayProps

Added in version 8.7.0

Configuration for the IdCaptureOverlay that IdCaptureAioView attaches by default. Every member is optional; omitted members keep the overlay’s own default.

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 an overlay.

capturedBrush
capturedBrush?: Brush

Added in version 8.7.0

Brush used to draw documents that were captured.

rejectedBrush
rejectedBrush?: Brush

Added in version 8.7.0

Brush used to draw documents that were rejected.

localizedBrush
localizedBrush?: Brush

Added in version 8.7.0

Brush used to draw documents that were localized but not yet captured.

idLayoutStyle
idLayoutStyle?: IdLayoutStyle

Added in version 8.7.0

Layout style of the viewfinder frame drawn for the document.

idLayoutLineStyle
idLayoutLineStyle?: IdLayoutLineStyle

Added in version 8.7.0

Line style of the viewfinder frame drawn for the document.

showTextHints
showTextHints?: boolean

Added in version 8.7.0

Whether the overlay shows scanning hint text.

textHintPosition
textHintPosition?: TextHintPosition

Added in version 8.7.0

Position of the hint text relative to the viewfinder.

frontSideTextHint
frontSideTextHint?: string

Added in version 8.7.0

Hint text shown while the front side of a document is being scanned.

backSideTextHint
backSideTextHint?: string

Added in version 8.7.0

Hint text shown while the back side of a document is being scanned.

IdCaptureAioViewHandle
interface IdCaptureAioViewHandle

Added in version 8.7.0

Imperative operations on an IdCaptureAioView, reached through a ref on the component.

reset()
reset(): Promise<void>

Added in version 8.7.0

Resets the underlying IdCapture mode’s capture session, discarding the documents captured so far.

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.