Skip to main content

builder

DocumentRecognition.Builder​

ParameterFunctionRequired
mobileTokenClient key that identifies that the collected data comes from your application. If you have not yet received your mobile-token, contact support.Yes.
.setDocumentSteps(DocumentRecognitionStep[] documentSteps)Defines the document capture flow performed by the user. More information hereYes.
.setSandboxEnvironment()If this parameter is used in the constructor, the library will be configured to send data to the sandbox environment. If absent, requests are sent to the production environment.No.
.showIntroductionScreens(Boolean showIntroductionScreens)When "false" disables the document photo collection introduction screens that appear to the user.No. Default is "true".
.setShowSuccessScreen(Boolean showSuccessScreen)When "false" disables the success screen after photo collection.No. Default is "true".
.setBackgroundColor(String backgroundColor)Allows configuration of the background color of the SDK activities.No. Default is "#ffffff".
.setFontColor(String fontColor)Allows configuration of the font color and icons of the SDK activities.No. Default is "#000000".
.setFontFamily(FontFamily fontFamily)Allows configuration of the font of the SDK activities.No. If not provided, the default is FontFamily.open_sans. Available fonts: FontFamily.open_sans, FontFamily.futura, FontFamily.verdana, FontFamily.roboto, FontFamily.poppins and FontFamily.helvetica.
.setVisualConfiguration(VisualConfiguration. visualConfiguration)Used to customize the images shown to the user throughout the SDK execution.No.
.setTextConfiguration(TextConfiguration. textConfiguration)Used to customize the onboarding introductory screen texts shown to the user throughout the SDK execution.No.
.setSessionId(String sessionId)Used to define the key that identifies the session started in the SDK. It is used to track the entire flow traversed by the user in the FaceRecon execution through logs. This field accepts up to 255 characters.No.
.setLogLevel(DocumentRecognition.LogLevel logLevel)Used to customize the verbosity level of the SDK logs. Available levels: LogLevel.debug, LogLevel.info, LogLevel.warn, LogLevel.error and LogLevel.trace. Default is LogLevel.debug.No.
.setAudioConfiguration(AudioConfiguration audioConfiguration)Configures the SDK spoken voice guidance, which narrates the capture instructions in real time. Accepted configurations are AudioConfiguration.enable, which shows the audio on/off button with narration starting muted; AudioConfiguration.disable, which disables narration and hides the button; and AudioConfiguration.accessibility, which shows the button with narration starting enabled when the device has accessibility features active. With TalkBack active, the full instructions are delivered by the screen reader itself.No. Default is AudioConfiguration.disable.
.setLanguage(String language)Sets the language of the SDK screens, accessibility messages and voice guidance, as a BCP 47 tag (for example pt-BR, en, es or zh-Hans). Supported languages: Portuguese (pt, pt-BR), English (en, en-US), neutral Spanish (es, es-MX, es-419) and Simplified Chinese (zh, zh-Hans, zh-CN). The tag is case-insensitive and _ is also accepted as a separator (pt_BR). An unsupported tag (such as fr or zh-TW) shows the SDK in English and logs a warning. The device language is not taken into account.No. If not provided, the default is Portuguese.
Language
  • The SDK never uses the device language: your integration chooses it. To follow your app's language, pass its tag, for example Locale.getDefault().toLanguageTag().
  • Custom onboarding texts (onboardingTextConfiguration) are shown exactly as provided. Send them already translated into the chosen language.
  • Voice guidance speaks in the chosen language when the device has a voice installed for it. Otherwise, the SDK narration stays off for that session. TalkBack still announces the instructions in the chosen language.
Android App Bundle

When the app is published as an Android App Bundle, Google Play installs only the languages set on the user's device. If your app chooses a language different from the device language, disable the language split in the app module build.gradle:

android {
bundle {
language {
enableSplit = false
}
}
}

When the translations for the chosen language are not installed, the SDK is shown in Portuguese and logs a warning.

The VisualConfiguration Object​

ParameterFunctionRequired
.setOnboardingDrawable(int onboarding_drawable, int onboarding_width)Used to configure the image shown to the user on the SDK onboarding screen. The onboarding_drawable parameter should reference the id of the image to be shown and onboarding_width is the desired display size of this image.No.
.setDocumentFullDrawable(int documentfull_drawable, int documentfull_width)Used to configure the image shown to the user on the SDK full CNH capture screen. The documentfull_drawable parameter should reference the id of the image to be shown and documentfull_width is the desired display size of this image.No.
.setDocumentFrontDrawable(int documentfront_drawable, int documentfront_width)Used to configure the image shown to the user on the SDK CNH and RG front capture screen. The documentfront_drawable parameter should reference the id of the image to be shown and documentfront_width is the desired display size of this image.No.
.setDocumentBackDrawable(int documentback_drawable, int documentback_width)Used to configure the image shown to the user on the SDK CNH and RG back capture screen. The documentback_drawable parameter should reference the id of the image to be shown and documentback_width is the desired display size of this image.No.
.setButtonBorderSize(int border_size)Used to configure the border width of the SDK buttons.No. Default is 1.
.setButtonShadow(boolean button_shadow)When set to false removes the shadow effect, default on android, used by the SDK buttons.No. Default is true.

The TextConfiguration Object​

ParameterFunctionRequired
.setCustomText(CustomLabel label, String text)Used to configure the texts shown to the user on the SDK onboarding screenNo.