Skip to main content

QITechIosFaceRecognitionConfiguration

SDK 7.0.0 and later

let onboardingTextConfiguration = OnboardingTextConfiguration(
onboardingTitle: "Relevant tips",
onboardingFirstLabel: "Keep your face visible",
onboardingSecondlabel: "Fit your face in the oval",
onboardingThirdLabel: "Remove accessories that cover your face"
)

let faceRecognitionConfig = QITechIosFaceRecognitionConfiguration(
environment: QITechIosFaceRecognitionEnvironment.sandbox,
clientSessionKey: clientSessionKey,
sessionId: "7d8c6f9a-f222-450d-9501-a07c68eb2388",
documentNumber: "123.456.789-00",
fontColor: "#337DFF",
backgroundColor: "#C9CCD3",
fontFamily: .open_sans,
showIntroductionScreens: true,
showSuccessScreen: true,
showInvalidTokenScreen: false,
audioConfiguration: AudioConfiguration.enable,
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: "To take a good photo:")
textConfiguration.setCustomText(on: .onboardingFirstLabel, text: "- Go to a well-lit place")
textConfiguration.setCustomText(on: .onboardingSecondLabel, text: "- Remove accessories and show your face clearly")
textConfiguration.setCustomText(on: .onboardingThirdLabel, text: "- Insert your face into the frame, waiting for it to turn green to capture")

let faceRecognitionConfig = QITechIosFaceRecognitionConfiguration(environment: QITechIosFaceRecognitionEnvironment.Sandbox,
clientSessionKey: clientSessionKey,
sessionId: "7d8c6f9a-f222-450d-9501-a07c68eb2388",
backgroundColor: "#C9CCD3",
fontColor: "#337DFF",
fontFamily: .open_sans,
showIntroductionScreens: true,
showSuccessScreen: false,
showInvalidTokenScreen: true,
activeFaceLiveness: true,
audioConfiguration: AudioConfiguration.Enable,
logLevel: .debug
)

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

The QITechIosFaceRecognitionConfiguration class is used so you can configure environment, credentials, visual and textual aspects, that is, all the necessary configurations for SDK personalization and operation.

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

nametypedescription
environmentQITechIosFaceRecognitionEnvironment(required) Enumerator that describes the environment.
clientSessionKeystring(required) Token sent by the face recognition API for SDK authentication.
sessionIdstring(optional) Unique ID used to track the entire flow taken by the user in FaceRecon execution through logs. This field accepts up to 255 characters.
documentNumberstring(optional) Used for user identification for anti-fraud and internal security
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.
showInvalidTokenScreenboolean(optional) Flag that indicates whether the authentication failure screen, with the token expiration message, should be shown. If not specified, the default is true.
audioConfigurationAudioConfiguration(optional) Configures the SDK spoken voice guidance, which narrates the capture instructions in real time. Accepted configurations are: Enable, which shows the audio on/off button with narration starting muted; Disable, which disables narration and hides the button; and Accessibility, which shows the button with narration starting enabled when the device has accessibility features active. With VoiceOver active, the full instructions are delivered by the screen reader itself.
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;
setDocumentNumberUsed to define the user's document number. This field accepts 14 characters of CPF formatted as follows 000.000.000-00Yes in all calls if using 1:1 validation at some point.
setValidationUsed to define whether the SDK should or should not perform 1:1 validation with the user's selfie. In the user's first session this flag must be mandatorily false. This function requires the setDocumentNumber method to be filled.No. Default is false.