ID Capture Listener

Defined under the namespace Scandit.Datacapture.Id

IdCaptureListener
interface IdCaptureListener

Added in version 6.13.0

Listener interface for id capture.

didCaptureId(idCapture, session, frameData)
didCaptureId?: (idCapture: IdCapture,
        session: IdCaptureSession,
        frameData: FrameData) => void

Added in version 6.13.0

Called whenever a document is recognized and parsed. In this callback IdCaptureSession.newlyCapturedId is guaranteed to be non-null.

didLocalizeId(idCapture, session, frameData)
didLocalizeId?: (idCapture: IdCapture,
        session: IdCaptureSession,
        frameData: FrameData) => void

Added in version 6.13.0

Called whenever a personal identification document or its part is localized within a frame. A document or its part is considered localized when it’s detected in a frame, but its data is not yet extracted. In this callback IdCaptureSession.localizedOnlyId is guaranteed to be non-null.

didRejectId(idCapture, session, frameData)
didRejectId?: (idCapture: IdCapture,
        session: IdCaptureSession,
        frameData: FrameData) => void

Added in version 6.13.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 (see IdCaptureSettings.supportedDocuments), (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. In this callback IdCaptureSession.newlyRejectedId is guaranteed to be non-null.

didUpdateSession(idCapture, session, frameData)
didUpdateSession?: (idCapture: IdCapture,
        session: IdCaptureSession,
        frameData: FrameData) => void

Added in version 6.17.0

Called after a frame has been processed by id capture and the session has been updated. In contrast to didCaptureId(), this method is invoked, regardless whether a document was scanned or not. If a document was recognized in this frame, this method is invoked after didCaptureId().

didFailWithError(idCapture, error, session)
didFailWithError?: (idCapture: IdCapture,
        error: IdCaptureError,
        session?: IdCaptureSession) => void

Added in version 6.13.0

Called whenever an error occurred during frame processing. When called with the error code IdCaptureErrorCode.RecoveredAfterFailure, the process responsible to scan images malfunctioned and was restarted. When scanning both front and back sides, the developer is responsible to reset the scanning process by calling IdCapture.reset() and inform the user to start over with the front side.

didTimedOut(idCapture, session, frameData)
didTimedOut?: (idCapture: IdCapture,
        session: IdCaptureSession,
        frameData: FrameData) => void

Added in version 6.18.0

Called whenever a document is localized, but could not be captured within a period of time. This can happen, for example, when the document contains defects preventing a successful scan or when the document is not supported by Scandit DataCapture.