Skip to main content

ZaigIosOcrConfiguration

let onboardingTextConfiguration = OnboardingTextConfiguration(
onboardingTitle: "Relevant tips",
onboardingFirstLabel: "Be in a well-lit place",
onboardingSecondLabel: "Remove the document from the envelope",
onboardingThirdLabel: "Frame the document in the marks"
)

let ocrConfig = ZaigIosOcrConfiguration(
environment: ZaigIosOcrEnvironment.sandbox,
mobileToken: "41fb4755-9bcf-4ae3-b981-b6009e51ce4a",
sessionId: "288eb399-4936-4133-ab2c-5611d6e5bb7a",
documentSteps: documentSteps,
fontColor: "#337DFF",
backgroundColor: "#C9CCD3",
fontFamily: .open_sans,
showIntroductionScreens: true,
showSuccessScreen: false,
onboardingTextConfiguration: onboardingTextConfiguration,
logLevel: .debug
)
Versions prior to v7.0.0

let visualConfiguration = VisualConfiguration()
visualConfiguration.setOnboarding(onboardingFilePath: Bundle.main.path(forResource: "onboarding", ofType: "png")!, onboardingWidth: 200)

let textConfiguration = TextConfiguration()
textConfiguration.setCustomText(on: .onboardingTitle, text: "Let's get started!")
textConfiguration.setCustomText(on: .onboardingFirstLabel, text: "- Go to a location with good lighting")
textConfiguration.setCustomText(on: .onboardingSecondLabel, text: "- Remove the document from the plastic")

let ocrConfig = ZaigIosOcrConfiguration(environment: ZaigIosOcrEnvironment.Sandbox,
mobileToken: "41fb4755-9bcf-4ae3-b981-b6009e51ce4a",
sessionId: "288eb399-4936-4133-ab2c-5611d6e5bb7a",
documentSteps: documentSteps,
backgroundColor: "#C9CCD3",
fontColor: "#337DFF",
fontFamily: .open_sans,
showIntroductionScreens: true,
showSuccessScreen: false,
logLevel: .debug
)

ocrConfig.setVisualConfiguration(visualConfiguration: visualConfiguration)
ocrConfig.setTextConfiguration(textConfiguration: textConfiguration)

The ZaigIosOcrConfiguration class is used so you can configure environment, credentials, visual and textual aspects, and the document image collection flow, that is, all the necessary settings for SDK customization and operation.

In the table below you will find the details of all arguments that must be used in its instantiation:

nametypedescription
environmentZaigIosOcrEnvironment(required) Enumerator that describes the environment.
mobileTokenstring(required) Token sent by QI Tech for SDK authentication.
sessionIdstring(optional) Unique ID used to track the entire flow taken by the user in the OCR execution through logs. This field accepts up to 255 characters.
documentStepsZaigIosOcrDocumentFlow(required) Enumerator that describes which validation flow will be followed, defining which document and which image capture order will be performed.
fontColorstring(optional) Hexadecimal of the font color. If not specified, the default is #1C49A5.
backgroundColorstring(optional) Hexadecimal of the screen background color. If not specified, the default is #FCFCFC.
fontFamilyFontFamily(optional) Font family. If not specified, the default is .open_sans. Available fonts: .open_sans, .futura, .verdana, .trebuchetms, .tamilsangammn and .system_font.
showIntroductionScreensboolean(optional) Flag that indicates whether the introduction screens, with instructions on how the photo should be captured, should be shown. If not specified, the default is true.
showSuccessScreenboolean(optional) Flag that indicates whether the success screen, with the success message on capture, should be shown. If not specified, the default is true.
onboardingTextConfigurationOnboardingTextConfiguration(optional) Allows configuring the instruction screen texts
logLevelLogLevel(optional) Used to customize the verbosity level of the SDK logs. Available levels: LogLevel.debug, LogLevel.info, LogLevel.warn, LogLevel.error and LogLevel.trace. If not specified, the default is LogLevel.debug.

In the table below you will find all methods accepted by the instance for configuration:

warning

DEPRECATED AS OF v7.0.0!

methodargumentsdescription
setVisualConfigurationvisualConfiguration : VisualConfiguration(optional) Class that allows modification of images displayed during SDK execution;
setTextConfigurationtextConfiguration : TextConfiguration(optional) Class that allows modification of texts displayed during SDK execution;