DocumentDetector
Plugin that calls native SDKs in Android and iOS.
Currently, the supported documents are RG, CNH, RNE and CRLV. If you have any suggestions for other documents, please contact us!
Importing
Using
General customizations
DocumentDetector |
CPF of the user who is using the plugin to be used for fraud detection via analytics |
Enables/disables data collection for maximizing anti-fraud information. Default is |
Flow of documents to be captured in the SDK |
Change the setting for the inflated popups before each document. The default is |
Enables/disables sounds. The default is |
Changes the default network settings. The default is |
Preview for checking photo quality |
Customizations only applied on Android |
Customizations only applied on iOS |
DocumentDetectorStep constructor |
Document to be scanned in this respective step |
Visual customizations of the respective step applied on Android |
Visual customizations of the respective step applied on iOS |
ShowPreview |
If you want to customize the values, create a String in |
Preview Enable/Disable |
Title |
Subtitle |
Confirmation Pushbutton Text |
Re-capture Button Text |
Android
DocumentDetectorStepCustomizationAndroid constructor |
Name of the string resource to be shown in the document name label. For example, if you want to show the String "Test", create a String in |
Name of the drawable resource to be shown in the capture intro popup. For example, if you want to show a custom illustration, save it in |
Name of the raw resource to run at the start of the capture. For example, if you want to play a custom audio, save it in |
DocumentDetectorAndroidSettings constructor |
Customization of the activity's Android layout |
Customization of the capture sensor settings |
Array of stages for each capture. This parameter is useful if you want to change the way the DocumentDetector runs, such as detection settings, automatic or manual capture, checking photo quality, etc. |
Permite habilitar ou desabilitar o botão de inversão da câmera. O padrão é |
CaptureStage constructor |
Duration in milliseconds of this respective step before moving on to the next, if any. |
Flag indicating if this stage should/should not undergo sensor validation |
Document Quality Check Settings. The only parameter of |
Document detection settings for the camera. The |
Photo capture mode. It can be |
DocumentDetectorCustomizationAndroid constructor |
Name of the style resource that defines the colors of the DocumentDetector. For example, if you want to change the colors of the SDK, create a style in |
Name of the resource layout that will replace the default DocumentDetector layout. For example, if you want to change the layout of the SDK, create a layout in |
Name of the drawable resource to replace the default green mask. If you are going to use this parameter, use a mask with the same cutting area, it is important for the detection algorithm. For example, save the mask image in |
Name of the drawable resource to replace the default red mask. If you are going to use this parameter, use a mask with the same cutting area, it is important for the detection algorithm. For example, save the mask image in |
Name of the drawable resource to replace the default white mask. If you are going to use this parameter, use a mask with the same cutting area, it is important for the detection algorithm. For example, save the mask image in |
SensorSettingsAndroid constructor |
Brightness sensor settings to be applied in all steps of the SDK |
Orientation sensor settings to be applied in all SDK steps |
Orientation sensor settings to be applied in all SDK steps |
SensorLuminositySettingsAndroid constructor |
Name of the string resource to be shown when the room is dark. The default message is "Environment too dark". For example, if you want to show the String "Test", create a String in |
Lower threshold between acceptable/not acceptable brightness, in lx. The default is |
SensorOrientationSettingsAndroid constructor |
Name of the string resource to be shown when the phone is not horizontal. The default message is "Cell phone is not horizontal". For example, if you want to show the String "Test", create a String in |
Lower threshold between correct/incorrect orientation, in m/s² variation from fully horizontal orientation. The default is |
SensorStabilitySettingsAndroid constructor |
Name of the string resource to be shown when the phone is not stable. The default message is "Keep cell phone still". For example, if you want to show the String "Test", create a String in |
How many milliseconds the cell phone must stay at the correct threshold to be considered stable. The default is |
Lower threshold between stable/unstable, in m/s² variation between the last two sensor collections. The default is |
iOS
DocumentDetectorIosSettings constructor |
Document acceptance threshold, in a value from 0.0 to 1.0. The default is 0.95 |
Flag indicating whether you want to check the quality of the captured document |
Quality acceptance threshold, between 1.0 and 5.0. 1.8 is recommended for future OCR |
Visual customization of the DocumentDetector |
Custom sensor settings in iOS, null to disable |
DocumentDetectorCustomizationIos constructor |
SDK theme color. For example, if you want to use the color black, use "#000000". |
Name of the image to replace the default green mask. Remember to add the image in |
Name of the image to replace the default white mask. Remember to add the image in |
Name of the image to replace the default red mask. Remember to add the image in |
Name of the image to replace the SDK close button. Remember to add the image in |
Flag indicating whether to show the label of the current step |
Flag indicating whether to show the current status label |
SensorSettingsIos constructor |
Brightness sensor settings to be applied in all steps of the SDK |
Orientation sensor settings to be applied in all SDK steps |
Stability sensor settings to be applied in all SDK steps |
SensorLuminositySettingsIos constructor |
String to be shown when the room is dark |
Lower threshold between acceptable/not acceptable brightness. The default is |
SensorOrientationSettingsAndroid constructor |
String to be shown when the cell phone is not horizontal |
Lower threshold between correct/incorrect orientation. Default is |
SensorStabilitySettingsAndroid constructor |
String to be shown when the cell phone is not stable |
Lower threshold between stable/unstable, in m/s² variation between the last two sensor collections. The default is |
Collecting the result
The DocumentDetector return object will have the result
attribute that contains a string SUCCESS
, FAILURE
or CLOSED
. The return will default to DocumentDetectorSuccess
, DocumentDetectorFailure
and DocumentDetectorClosed
, respectively, for each of the cases.
DocumentDetectorSuccess
Field | Observation |
List of document captures | It will have the same length and order as the ** |
Document type detected by the SDK itself, useful for integration with our external OCR route. For example, if you capture | Will be null if the SDK cannot check the document type or if detection is disabled |
Identificador dessa execução em nossos servidores. Se possível, salve este campo e mande-o junto para nossa API. Assim, teremos mais dados de como o usuário se comportou durante a execução | Will be null if the user sets |
Capture
Field | Observation |
Full address of the image on the device | - |
URL of the image temporarily stored on CAF servers | Will be null if the SDK cannot check the quality or if the quality is disabled |
Label for detecting the capture. For example, if the capture refers to a | Will be null if the photo is collected at a stage where detection is disabled |
Quality of the document photo, in a value from 1.0 to 5.0 | Will be null if the photo is collected at a stage where quality checking is disabled |
DocumentDtetectorFailure
Field |
Friendly message explaining why the SDK failed |
Fault type that shut down the SDK |
The existing fault types are:
InvalidTokenReason
: when the token entered is invalid. It should not occur in a production environment;PermissionReason
: when some mandatory permission was not granted by the user. It will only happen in a production environment if your app does not ask your user or the user manually disables it before starting;NetworkReason
: server connection failure. Will occur in production if the user's device is without internet;ServerReason
: failure in some request with our servers. It will occur in production only in case of our failure;SecurityReason
: when the device is not safe to run the SDK. If this failure occurs, let us know;StorageReason
: when the device does not have enough space to capture some photo. This can happen in production;LibraryReason
: when some internal failure made it impossible to run the SDK. It can occur due to configuration errors in the project, it should not occur in production;
DocumentDetectorClosed
Empty object indicating closure of the capture screen by the user.
Last updated