ID Capture Listener

Defined in package com.scandit.datacapture.id

IdCaptureListener
interface IdCaptureListener

Added in version 8.6.0

Listener interface for id capture.

onIdCaptured(mode, id)
fun onIdCaptured(mode: IdCapture,
        id: CapturedId)

Added in version 8.6.0

Called whenever a document is recognized and parsed.

Set IdCapture.isEnabled to false at the start of this callback to prevent additional captures while the result is being handled, and restore it to true when processing is complete. This method is called on a background thread — dispatch any UI work to the main thread.

onIdRejected(mode, id, reason)
fun onIdRejected(mode: IdCapture,
        id: CapturedId?,
        reason: RejectionReason)

Added in version 8.6.0

Called whenever a personal identification document or its part is recognized in a frame, but rejected. A document is rejected if (a) it’s not enabled in the settings, (b) it’s a barcode of a correct symbology or a Machine Readable Zone (MRZ), but the data is encoded in an unexpected/incorrect format, (c) it meets the requirement of a rejection rule defined in the settings (for instance, voided ID rejection or expired ID rejection).

This method is called on a background thread — dispatch any UI work to the main thread.