Skip to main content

View Options

View Options defines event handlers for events triggered in the course of the user performing the scan with a Custom Scan View


onPromptUser

Parameters:

{prompt: String}

Purpose

This callback is called when the flow requires prompting the user. In the custom view flow it is up to you to decide how you would like to prompt the user. The type of prompt will be provided as a string in data.prompt.

Prompts:

flipCard

The first side has been scanned, the user should be prompted to present the other side of the card to the camera.

wrongCard

The wrong card was detected. The user should be prompted to show the correct card to the camera.

fewDigitsSeen

We haven't detected a card number yet, it's possible the user is not showing a card to the camera. The user should be instructed to show the side of the card with digits on it to the camera.


onProgress

Parameters:

{progress: float}

Purpose

Provides a value between 0.0 and 100.0 indicating the scan's progress. This can be used to show a progress bar to the user.


onAnalysis

Parameters:

None

Purpose:

Called when image analysis has begun. This is a good time to update UI state to indicate that the scan is processing.


onScanStarted

Parameters:

None

Purpose:

The scan has started. You can provide visual feedback to the user that the scan is in progress.