Message Handler

All SDKs provide a unique MessageHandler to indicate the success, failure or exit of the SDK.

MessageHandler signature

MessageHandler(message:Message)

The message contains 2 properties:

  • code

  • step

The code is a string constant which describe the case.

The step will indicate at which step of the process the user was when this event occurred.

Below, the list of codes and steps that can be fired:

Success

Code
Message

success_onboarding

The user has successfully completed the onboarding process.

success_authenticate

The applicant has been successfully authenticated.

Exit

Code
Message

exit

The user exited the SDK flow without completing the process.

Failure

Code
Message

access_token_required

The access token must be provided.

sdk_configuration_failed

A problem occurred when retrieving the SDK configuration.

context_failed

A problem occurred during context initialisation.

ai_failed

A problem occurred in the AI processing

assets_failed

A problem occurred when loading assets.

error_failed

A problem occurred when sending the error to the server.

reset_failed

A problem occurred during reset.

no_camera

No cameras can be used.

set_frame_rate_failed

A problem has occurred when setting the frame rate.

process_image_failed

A problem has occurred during image processing.

process_video_failed

A problem has occurred during video processing.

no_http_response

No HTTP response was received.

invalid_status_code

The status code received by server is invalid. (code)

serialization_failed

A problem occurred during data serialization.

too_many_errors

Too many errors occurred during the operation.

camera_access_refused

Access to the camera has been denied by the user

session_expired

The session has expired.

http_timeout

The HTTP request timed out.

lost_internet_connection

The internet connection was lost.

Step

Step
Description

PRE_PROCESS

Everything before

DOC_CHOICE

The user is choosing a document to scan

COUNTRY_CHOICE

The user is choosing which country the document is emited by

DOC_SCAN

The user scans the document using the rear mobile camera

FACE_SCAN

The user scans his face using the front mobile camera

POST_PROCESS

Everything after

Important

By default, all errors returned by the response handler are displayed on a screen to interrupt the process and prevent malfunctions.

These errors can be displayed or not by the developer by specifying the shouldShowError value.

(only screens related to ERROR_HTTP_TIMEOUT, ERROR_LOST_INTERNET_CONNECTION, ERROR_TOO_MANY_ERRORS cannot be ignored by this value)

Warning

ERROR_SESSION_EXPIRED and ERROR_CAMERA_ACCESS_REFUSED errors can cause the application to malfunction if not handled by the developer when the shouldShowError value is set to false.

Last updated