Teydex iOS Document
This document contains all the necessary steps, usage examples, and platform-specific technical details for integrating the Teydex library securely and seamlessly on the iOS platform.
Version Requirements
Check your versions to use the Teydex iOS library without issues.
| Platform | Min version |
|---|---|
| iOS | iOS 15.0 |
| Swift 5.5 | |
| Xcode 26.1 |
Installation via Swift Package Manager
To add the KYCFramework package to your project, go to File > Add Package Dependencies in Xcode and enter the package URL below. The library will automatically download all required dependencies.
https://github.com/innovance-technologies/KYCFramework.git
Project Configuration
Background Modes Settings
In the Signing & Capabilities tab, make sure the following options are checked under Background Modes:
- Audio, AirPlay, and Picture in Picture
- Voice over IP
- Background fetch
Info.plist Permissions
You need to add the following descriptions to your application's Info.plist file. These messages will be shown to users when permissions are requested:
<key>NSCameraUsageDescription</key>
<string>Allow access so others can see you during video calls</string>
<key>NSLocationWhenInUseUsageDescription</key>
<string>Allow access so your location can be verified</string>
<key>NSLocationAlwaysAndWhenInUseUsageDescription</key>
<string>Allow access so your location can be verified</string>
<key>NSMicrophoneUsageDescription</key>
<string>Allow access so others can hear you during video calls</string>
<key>NSPhotoLibraryAddUsageDescription</key>
<string>Allow access to save your photos to the photo gallery</string>
<key>NSPhotoLibraryUsageDescription</key>
<string>Allow access to browse your photo gallery</string>
<key>NSLocationTemporaryUsageDescriptionDictionary</key>
<dict>
<key>FullAccuracy</key>
<string>Allow access so your location can be verified</string>
</dict>
<key>NSSpeechRecognitionUsageDescription</key>
<string>Allow access to recognize speech</string>
Info Screen
The Info screen in your KYC application refers to the information pages displayed before steps. Optionally, the following parameters can be added for each step.
Info Screen Properties
| Parameter | Type | Description |
|---|---|---|
| setTitleText | String | Specifies the title text to be displayed on the Info screen. |
| setDescriptionText | String | Specifies the description text to be displayed on the Info screen. |
| setButtonText | String | Specifies the text of the button that will start the step shown on the Info screen. |
| setAssetImageName | String | Specifies the image to be shown on the Info screen. |
| setLottieFileName | String | Specifies the Lottie animation to be shown on the Info screen. |
| setBullets | [String] | Can be used when you want to provide bullet-point information about the next step on the Info screen. |
| bulletIconName | @RawRes Int | Can be used to change the icon of bullet items displayed on the Info screen. |
| setCancelButtonIsActive | Bool | Enables or disables the cancel button in the top-right corner of the Info screen. Disabled by default. |
Info Screen Usage
let frontInfo = InfoPresentationModelBuilder()
.setTitleText("ID Card Front")
.setDescriptionText("Please follow the steps below carefully:")
.setButtonText("Continue")
.setLottieFileName("front")
.setBullets([
"Place Your ID\n" +
"Hold the front of your ID parallel to the phone screen. The ID must be positioned so that it fits completely within the template shown on the screen.",
"Visibility of ID Information\n Make sure all information on the ID is clearly visible. The ID information should not be blurry and must be easily readable."
])
.build()
Glare Detection
Starting with v1.3.1, glare detection has been added to the Front, Back, Liveness, and Passport steps to ensure the user presents the document under appropriate lighting conditions. If the environment is too bright, too dark, or there is glare on the document, a warning text is shown to the user on the relevant screen.
The following parameters can be used commonly in the Front, Back, and Passport steps:
| Parameter | Type | Description |
|---|---|---|
| isGlareDetectionEnable | Bool | Enables glare detection for the relevant step. Default is true for Front and Back, false for Passport. |
| glareDetectedText | String | Text displayed when glare is detected on the document. |
| tooBrightText | String | Warning text displayed when the environment is too bright. |
| tooDarkText | String | Warning text displayed when the environment is too dark. |
| multipleDocumentsDetectedText | String | Warning text displayed when multiple documents are detected by the camera. |
The Liveness step only has parameters related to ambient lighting:
| Parameter | Type | Description |
|---|---|---|
| isGlareDetectionEnable | Bool | Enables ambient light monitoring in the Liveness step. Default is true. |
| tooBrightText | String | Warning text displayed when the environment is too bright. |
| tooDarkText | String | Warning text displayed when the environment is too dark. |
If any of these parameters are not provided, the SDK uses default Turkish warning texts.
Steps
The properties to be used in all steps are specified in this section. These properties are available in every step (Front, Back, Hologram, NFC, Liveness, VideoCall).
Step Properties
| Parameter | Type | Description |
|---|---|---|
| setInfoView | Info | Used to add an Info screen to the relevant step. Optional. |
| setTitle | String | Represents the Toolbar text to be displayed in the relevant step. |
| setStepType | StepType | Specifies the type of the step (.idcardFront, .idcardBack, etc.) |
| setStepInformationTextToSpeech | String | Represents the text to be read aloud at the beginning of the step. |
| setIdentifyTimeout | TimeInterval | Sets the timeout duration for the relevant step. Default value is 30. |
setIsGlareDetectionEnable | Bool? | Enables glare detection. |
setGlareDetectedText | String? | Warning displayed when glare is detected. |
setTooBrightText | String? | Warning displayed when the environment is too bright. |
setTooDarkText | String? | Warning displayed when the environment is too dark. |
setMultipleDocumentsDetectedText | String? | Warning displayed when multiple documents are detected. |
Liveness Step Properties
| Parameter | Type | Description |
|---|---|---|
| setDirectionTextToSpeech | String, String, String, String, String | Sets the text-to-speech message for center, right, left, up, down directions. |
ID Card Front Step
let idFrontStep = StepBuilder()
.setIdentifyTimeout(35)
.setTitle("Front Side")
.setInfoView(frontInfo)
.setStepType(.idcardFront)
.setStepInformationTextToSpeech("Hold the front of your ID parallel to the phone screen. The ID must be positioned completely within the template.")
.setIsGlareDetectionEnable(true)
.setGlareDetectedText("Glare detected. Please hold the document at a different angle.")
.setTooBrightText("Environment is too bright. Please reduce the light.")
.setTooDarkText("Environment is too dark. Please move to a brighter area.")
.setMultipleDocumentsDetectedText("Please show only one document.")
.build()
ID Card Back Step
let idBackStep = StepBuilder()
.setIdentifyTimeout(35)
.setTitle("Back Side")
.setInfoView(backInfo)
.setStepType(.idcardBack)
.setStepInformationTextToSpeech("Hold the back of your ID parallel to the phone screen. Make sure all information is clearly visible.")
.setIsGlareDetectionEnable(true)
.setGlareDetectedText("Glare detected. Please hold the document at a different angle.")
.setTooBrightText("Environment is too bright. Please reduce the light.")
.setTooDarkText("Environment is too dark. Please move to a brighter area.")
.setMultipleDocumentsDetectedText("Please show only one document.")
.build()
NFC Step
let nfcStep = StepBuilder()
.setIdentifyTimeout(35)
.setTitle("NFC")
.setInfoView(nfcInfo)
.setStepType(.nfc)
.setStepInformationTextToSpeech("Hold your ID close to the back of your phone. Make sure NFC is enabled.")
.build()
Hologram Step
let hologramStep = StepBuilder()
.setIdentifyTimeout(35)
.setTitle("Hologram")
.setInfoView(hologramInfo)
.setStepType(.hologram)
.setStepInformationTextToSpeech("Scan the hologram label on your ID. The hologram should be clearly visible.")
.build()
Liveness Step
LivenessStepBuilder is used for the Liveness step. This builder provides the setDirectionTextToSpeech method to set direction-based TTS messages.
let faceStep = LivenessStepBuilder()
.setDirectionTextToSpeech(
center: "Look straight ahead, keeping your face in the center of the frame.",
right: "Turn your face to the right.",
left: "Turn your face to the left.",
up: "Turn your face upward.",
down: "Turn your face downward."
)
.setIdentifyTimeout(35)
.setTitle("Liveness Check")
.setInfoView(faceInfo)
.setStepInformationTextToSpeech("Look at the camera and position your face within the frame. Move your head according to the instructions.")
.setIsGlareDetectionEnable(true)
.setTooBrightText("Environment is too bright. Please reduce the light.")
.setTooDarkText("Environment is too dark. Please move to a brighter area.")
.build()
Note:
setGlareDetectedTextandsetMultipleDocumentsDetectedTextare not supported in the Liveness step; onlytooBrightTextandtooDarkTextare valid.
VideoCall Step
let videoCall = StepBuilder()
.setIdentifyTimeout(35)
.setTitle("Video Call")
.setInfoView(videoCallInfo)
.setStepType(.videoCall)
.setStepInformationTextToSpeech("Video call is starting. Make sure you have sufficient lighting.")
.build()
LivenessConfig
Used to customize the UI texts and visual style in the Liveness step.
LivenessConfig Properties
| Parameter | Type | Description |
|---|---|---|
| dotRadius | CGFloat? | Specifies the radius of the dots displayed on screen during the liveness check. |
| dotColor | UIColor? | Defines the default color of the dots used as liveness indicators. |
| activeDotColor | UIColor? | Sets the color of the active dot during the liveness check. |
| titleText | String? | The main title text displayed during the liveness check. |
| upText | String? | Instruction text displayed when the user needs to move their head upward. |
| downText | String? | Instruction text displayed when the user needs to move their head downward. |
| leftText | String? | Instruction text displayed when the user needs to turn their head to the left. |
| rightText | String? | Instruction text displayed when the user needs to turn their head to the right. |
| centerYourFaceText | String? | Instruction text asking the user to center their face within the frame. |
| faceNotDetectedText | String? | Message displayed when the user's face is not detected during the liveness check. |
| overlayText | String? | Text shown on the overlay before the face detection circle appears. |
LivenessConfig Usage
let livenessConfig = LivenessConfig(
dotRadius: 10.0,
dotColor: .gray,
activeDotColor: .green,
titleText: "Face Verification",
upText: "Please raise your head up",
downText: "Please lower your head",
leftText: "Please turn your head to the left",
rightText: "Please turn your head to the right",
centerYourFaceText: "Please center your face",
faceNotDetectedText: "Face could not be detected"
)
UIConfig
Used to configure the visual styles used in Info screens and bottom sheets.
UIConfig groups color, typography, shape, and bullet icon settings under a single structure.
UIConfig Properties
| Parameter | Type | Description |
|---|---|---|
| colors | ColorsConfig? | Used to configure the color settings for Info screens and bottom sheets. |
| typography | TypographyConfig? | Used to configure the font family, font sizes, and font weights to be used throughout the SDK. |
| shapes | ShapesConfig? | Used to configure the shape settings for Info screens and bottom sheets. |
| bulletIconName | String? | Specifies the name of the icon used for bullet points in Info screens and bottom sheets. |
| textConfig | TextConfig? | Used to customize the button texts on the photo approval screen. |
ColorsConfig Properties
| Parameter | Type | Description |
|---|---|---|
| buttonColor | UIColor? | Specifies the background color of buttons displayed in Info screens and bottom sheets. |
| buttonTextColor | UIColor? | Sets the text color of buttons displayed in Info screens and bottom sheets. |
| bulletTextColor | UIColor? | Defines the color of bulleted texts in Info screens and bottom sheets. |
| titleColor | UIColor? | Defines the color of the title text on Info screens. |
| descriptionColor | UIColor? | Defines the color of the description text on Info screens. |
ShapesConfig Properties
| Parameter | Type | Description |
|---|---|---|
| buttonCornerRadius | Int? | Sets the corner radius of buttons for styling purposes. |
TextConfig Properties
| Parameter | Type | Description |
|---|---|---|
| approveButtonText | String? | Text of the approve button shown after a photo is captured. |
| retakeButtonText | String? | Text of the retake button shown after a photo is captured. |
TypographyConfig Properties
| Parameter | Type | Description |
|---|---|---|
| fontFamily | String? | Specifies the font family name to be used throughout the SDK. Example: "Inter", "Inter-Regular", "Roboto". |
| titleFontSize | CGFloat | Specifies the font size to be used in title texts. Default value: 28. |
| bodyFontSize | CGFloat | Specifies the font size to be used in body texts. Default value: 16. |
| buttonFontSize | CGFloat | Specifies the font size to be used in button texts. Default value: 16. |
| labelFontSize | CGFloat | Specifies the font size to be used in small helper label texts and light condition warnings. Default value: 14. |
| timerFontSize | CGFloat | Specifies the font size to be used in timer texts. Default value: 32. |
| titleFontWeight | Int | Specifies the font weight to be used in title texts. Supported values: 100, 400, 500, 700, 900. Default value: 700. |
| bodyFontWeight | Int | Specifies the font weight to be used in body, label, and button texts. Supported values: 100, 400, 500, 700, 900. Default value: 400. |
UIConfig Usage Example
let colorsConfig = ColorsConfig(buttonColor: UIColor(named: "purple_700"),
buttonTextColor: .white,
bulletTextColor: UIColor(named: "teal_700")
)
let shapesConfig = ShapesConfig(buttonCornerRadius: 30)
let typographyConfig = TypographyConfig(fontFamily: "Inter",
titleFontSize: 28,
bodyFontSize: 16,
buttonFontSize: 16,
labelFontSize: 14,
timerFontSize: 32,
titleFontWeight: 700,
bodyFontWeight: 400
)
let uiConfig = UIConfig(colors: colorsConfig,
typography: typographyConfig,
shapes: shapesConfig,
bulletIconName: "bullet_icon"
)
Usage with KYCManagerConfigBuilder
let configuration = KYCManagerConfigBuilder()
.setUIConfig(
UIConfig(colors: ColorsConfig(buttonColor: UIColor(named: "purple_700"),
buttonTextColor: .white,
bulletTextColor: UIColor(named: "teal_700")),
typography: TypographyConfig(fontFamily: "Inter",
titleFontSize: 28,
bodyFontSize: 16,
buttonFontSize: 16,
labelFontSize: 14,
timerFontSize: 32,
titleFontWeight: 700,
bodyFontWeight: 400),
shapes: ShapesConfig(buttonCornerRadius: 30),
.setUIConfig(UIConfig(colors: ColorsConfig(buttonColor: .systemPink,
buttonTextColor: .white,
bulletTextColor: .black),
typography: TypographyConfig(fontFamily: "Luculine",
titleFontSize: 28,
bodyFontSize: 27,
buttonFontSize: 16,
labelFontSize: 14,
timerFontSize: 32,
titleFontWeight: 700,
bodyFontWeight: 400),
shapes: ShapesConfig(buttonCornerRadius: 24),
textConfig: TextConfig(approveButtonText: "Approve",
retakeButtonText: "Retake")))
bulletIconName: "bullet_icon"))
.build()
KYCManagerConfig
Determines the general behavior, error messages, and UI configuration of the KYC flow.
KYCManagerConfig Parameters
| Parameter | Type | Description |
|---|---|---|
| showCompletedScreen | Bool | Controls whether the screen to be shown upon successful completion of the process is enabled or disabled. Defaults to false. |
| cameraErrorMessage | [String] | Allows customization of messages used for camera errors. |
| nfcErrorMessage | [String] | Allows customization of messages used for NFC errors. |
| videoCallErrorMessage | [String] | Allows customization of messages used for video call errors. |
| timeOutErrorMessage | [String] | Allows customization of messages used for timeout errors. |
| serverErrorMessage | [String] | Allows customization of messages used for server errors. |
| rejectedErrorMessage | [String] | Allows customization of messages used for rejection errors. |
| identityReadFailedError | [String] | Allows customization of messages used for identity read errors. |
| videoCallSplashScreenAssetName | String | Used to customize the full-screen image displayed when the video call screen opens. |
| closeIconAssetName | String | Used to customize the image used for the close button in Info screens. |
| livenessConfig | LivenessConfig | Used to customize the instructions in the Liveness step. |
| uiConfig | UIConfig? | Used to customize the instructions in the Info screen and bottom sheet. |
| ttsConfig | TTSConfig | Used for customization of the text-to-speech feature. |
| videoCallExternalLogoImage | UIImage | Used to customize the logo displayed when the video call screen opens. |
| documentAutoDetectError | [TeydexError.DocumentAutoDetectError: String]? | Custom message dictionary for document auto-detection errors. |
KYCManagerConfig Usage
let configuration = KYCManagerConfigBuilder()
.setCameraErrorMessage([.cameraPermissionDenied: "Camera permission denied"])
.setNFCErrorMessage([.deviceNotHaveNFC: "Your device does not have NFC"])
.setShowCompletedScreen(true)
.setVideoCallSplashScreenAssetName("splash_background")
.setCloseIconAssetName("close_icon")
.setLivenessConfig(livenessConfig)
.setUIConfig(uiConfig)
.setTTSConfig(TTSConfig(isEnabled: true, speechRate: 0.5, language: "tr-TR"))
.setVideoCallExternalLogoImage(UIImage(named: "your_logo") ?? UIImage())
.build()
KYCManagerDelegate
The delegate protocol used to handle events and errors during the KYC process.
import KYCFramework
class ViewController: UIViewController, KYCManagerDelegate {
func onProcessFinished(_ result: KYCProcessResult) {
// Called once when the KYC flow ends for any reason.
switch result {
case .successful:
print("KYC process completed successfully")
case .failed(let step, let reason):
print("KYC failed — step: \(String(describing: step)), reason: \(reason)")
case .cancelled(let step, let reason):
print("KYC cancelled — step: \(String(describing: step)), reason: \(reason)")
}
}
func onCompletion(_ isSuccess: Bool) {
// You can listen to whether the identity verification step was successful through this function.
if isSuccess {
print("KYC process completed successfully")
} else {
print("KYC process failed")
}
}
// The onEvent and onError functions allow you to handle which steps were opened,
// which operations were performed, and the error states that occurred during the identity verification process.
// These functions provide the necessary information for logging to platforms such as Countly and Firebase.
func onEvent(_ event: LogState) {
print("KYC Event: \(event)")
}
func onError(_ error: TeydexError) {
print("KYC Error: \(error)")
}
override func viewDidLoad() {
super.viewDidLoad()
TeydexSDK.shared.kycManager.delegate = self
}
}
dismissKYC
Used to programmatically close the KYC flow from outside the SDK. When called, the onProcessFinished delegate method is triggered with .cancelled(reason: .programmatic).
onProcessFinished
Reports the result of the KYC flow with three cases:
| Case | Description |
|---|---|
.successful | All steps completed successfully. |
.failed(step:reason:) | Flow ended due to an error at the specified step. |
.cancelled(step:reason:) | Flow was cancelled. You can learn the reason with KYCCancelReason. |
kycManager.dismissKYC()
Starting the KYC Flow
enterKYC Function
TeydexSDK.shared.kycManager.enterKYC(
from: viewController, // UIViewController or UINavigationController
clientToken: token, // Unique token for authentication
applicationId: applicationId, // Application ID for authentication
stepList: stepList, // List of steps
configuration: configuration, // KYCManagerConfig (optional)
initializeUrl: "https://your.api.domain.com/api/v1", // API base URL
useLocation: false // Should location data be recorded? Default: false
)
If the video call flow will be used, the videoCallUrl: parameter should also be added.
Important: The
fromparameter must be given aUINavigationControlleror aUIViewControllerthat has anavigationController.
Full Configuration Example
class KYCConfig {
// Front Info
static let frontInfo = InfoPresentationModelBuilder()
.setButtonText("Continue")
.setDescriptionText("Please follow the steps below carefully")
.setTitleText("Front Side")
.setBullets(["Hold the front of your ID parallel to the phone screen. The ID should be positioned so that it fits exactly within the template shown on screen.",
"Make sure all the information on the ID is clearly visible. The ID details should not be blurry and must be easy to read."])
.setCancelButtonIsActive(true)
.build()
// Back Info
static let backInfo = InfoPresentationModelBuilder()
.setButtonText("Continue")
.setDescriptionText("Please follow the steps below carefully")
.setTitleText("Back Side")
.setBullets(["Hold the back of your ID parallel to the phone screen. The ID should be positioned so that it fits exactly within the template shown on screen.",
"Make sure all the information on the ID is clearly visible. The ID details should not be blurry and must be easy to read."])
.setCancelButtonIsActive(true)
.build()
// NFC Info
static let nfcInfo = InfoPresentationModelBuilder()
.setButtonText("Continue")
.setDescriptionText("Please follow the steps below carefully")
.setTitleText("NFC")
.setBullets(["Make sure NFC is enabled on your phone. NFC can be turned on from your phone's settings.",
"Touch the NFC-compatible area of your ID to the back of your phone. Keep the distance between the ID and the phone as short as possible.",
"Wait for your ID data to be transferred to your phone successfully. Once your phone picks up the NFC signal, a notification should appear on your screen indicating that the verification process has started."])
.setCancelButtonIsActive(true)
.build()
// Liveness Info
static let faceInfo = InfoPresentationModelBuilder()
.setButtonText("Continue")
.setDescriptionText("Please follow the steps below carefully")
.setTitleText("Liveness")
.setBullets(["Look directly at your device's camera and make sure your face is clearly visible on screen. Following the instructions on your device's screen, you may need to move your head in a specific way.",
"Following the prompts on screen, you may turn your head right, left, up, and down. Remember that your face needs to look natural and lifelike."])
.setCancelButtonIsActive(true)
.build()
// Hologram Info
static let hologramInfo = InfoPresentationModelBuilder()
.setButtonText("Continue")
.setDescriptionText("Please follow the steps below carefully")
.setTitleText("Hologram")
.setBullets(["Position the front of your ID clearly within the time shown on screen. You need to properly capture the bright reflection of the hologram label on your ID.",
"Make sure you can see your ID details clearly. Ensure there is enough light and that all the information on the ID is distinct so it can be captured."])
.setCancelButtonIsActive(true)
.build()
// VideoCall Info
static let videoCallInfo = InfoPresentationModelBuilder()
.setButtonText("Continue")
.setDescriptionText("Get ready to scan your face and move to a well-lit area.")
.setTitleText("Video Call")
.setBullets(["Make sure your device's camera and microphone are working.",
"Make sure you have enough light so that your face is clearly visible."])
.setCancelButtonIsActive(true)
.build()
// Steps
static let idFrontStep = StepBuilder()
.setIdentifyTimeout(35)
.setTitle("ID Front Side")
.setInfoView(frontInfo)
.setStepType(.idcardFront)
.setStepInformationTextToSpeech("Hold the front of your ID parallel to the phone screen. The ID must be placed exactly within the template.")
.setIsGlareDetectionEnable(true)
.setGlareDetectedText("There is glare. Please hold the document at a different angle.")
.setTooBrightText("The environment is too bright. Please reduce the light.")
.setTooDarkText("The environment is too dark. Please move to a brighter area.")
.setMultipleDocumentsDetectedText("Show only a single document.")
.build()
static let idBackStep = StepBuilder()
.setIdentifyTimeout(35)
.setTitle("Back Side")
.setInfoView(backInfo)
.setStepType(.idcardBack)
.setStepInformationTextToSpeech("Hold the back of your ID parallel to the phone screen. Make sure all the information is clearly visible.")
.setIsGlareDetectionEnable(true)
.setGlareDetectedText("There is glare. Please hold the document at a different angle.")
.setTooBrightText("The environment is too bright. Please reduce the light.")
.setTooDarkText("The environment is too dark. Please move to a brighter area.")
.setMultipleDocumentsDetectedText("Show only a single document.")
.build()
static let nfcStep = StepBuilder()
.setIdentifyTimeout(35)
.setTitle("NFC")
.setInfoView(nfcInfo)
.setStepType(.nfc)
.setStepInformationTextToSpeech("Bring your ID close to the back of your phone. Make sure NFC is enabled.")
.build()
static let faceStep = LivenessStepBuilder()
.setDirectionTextToSpeech(
center: "Hold your face in the center of the frame and look straight ahead.",
right: "Turn your face to the right.",
left: "Turn your face to the left.",
up: "Turn your face up.",
down: "Turn your face down."
)
.setIdentifyTimeout(35)
.setTitle("Liveness Check")
.setInfoView(faceInfo)
.setStepInformationTextToSpeech("Look at the camera and place your face in the frame. Move your head according to the prompts.")
.setIsGlareDetectionEnable(true)
.setTooBrightText("The environment is too bright. Please reduce the light.")
.setTooDarkText("The environment is too dark. Please move to a brighter area.")
.build()
static let hologramStep = StepBuilder()
.setIdentifyTimeout(35)
.setTitle("Hologram")
.setInfoView(hologramInfo)
.setStepType(.hologram)
.setStepInformationTextToSpeech("Scan the hologram label on your ID. The hologram should appear bright.")
.build()
static let videoCall = StepBuilder()
.setIdentifyTimeout(35)
.setTitle("Video Call")
.setInfoView(videoCallInfo)
.setStepType(.videoCall)
.setStepInformationTextToSpeech("Starting the video call. Make sure there is enough light.")
.build()
// Text to Speech Configuration
static let defaultTTSConfig = TTSConfig(
isEnabled: true,
language: "en-US",
speechRate: 0.5,
volume: 1.0,
pitchMultiplier: 1.0,
preUtteranceDelay: 0.0,
postUtteranceDelay: 0.0
)
// Configuration
static let configuration = KYCManagerConfigBuilder()
.setCameraErrorMessage([
.cameraPermissionDenied: "Camera permission denied. Please grant camera permission."
])
.setShowCompletedScreen(true)
.setVideoCallSplashScreenAssetName("IdCard")
.setVideoCallExternalLogoImage(UIImage(named: "IdCard"))
.setTTSConfig(defaultTTSConfig)
.setUIConfig(UIConfig(colors: ColorsConfig(buttonColor: .systemPink,
buttonTextColor: .white,
bulletTextColor: .black),
typography: TypographyConfig(fontFamily: "Luculine",
titleFontSize: 28,
bodyFontSize: 27,
buttonFontSize: 16,
labelFontSize: 14,
timerFontSize: 32,
titleFontWeight: 700,
bodyFontWeight: 400),
shapes: ShapesConfig(buttonCornerRadius: 24),
textConfig: TextConfig(approveButtonText: "Approve",
retakeButtonText: "Retake")))
.build()
// Helper functions
static func getStepList() -> [Step] {
return [idFrontStep, idBackStep, hologramStep, nfcStep, faceStep, videoCall]
}
static func getManagerConfig() -> KYCManagerConfig {
return configuration
}
}
Error Management
The error types that can come from the SDK are listed below. All errors are communicated via the onError(_ error: TeydexError) method of KYCManagerDelegate. Error messages can be customized via KYCManagerConfigBuilder.
Camera Errors (TeydexError.CameraSourceError)
| Case | Description |
|---|---|
cameraPermissionDenied | Camera permission was denied. |
cameraPermissionPermenantlyDenied | Camera permission was permanently denied. |
deviceNotHaveCameraFeature | No camera found on the device. |
deviceInitFailed | Camera could not be initialized. |
flashMode | Error turning flash on/off. |
capturePhotoFailed | An error occurred while taking a photo. |
videoRecordingFaild | An error occurred while recording video. |
vidoConfigurationFaild | Camera preview could not be created. |
videoDeleteFaild | Temporary video could not be deleted. |
unknown | Unknown camera error. |
NFC Errors (TeydexError.NFCError)
| Case | Description |
|---|---|
deviceNotHaveNfc | The device does not have an NFC module. |
nfcDisabled | NFC is disabled. |
nfcReadFailed | ID information could not be read. |
nfcTagLost | ID connection was lost during reading. |
nfcTagNotSupported | ID card is not supported. |
nfcTagNotSupportIsoDep | NFC chip is not supported. |
cantConnectNfcTag | Could not connect to NFC tag. |
wrongMrzString | MRZ information could not be verified. |
externalAuthFailed | External authentication failed. |
passiveAuthFailed | Passive authentication failed. |
moreThanOneTagFound | More than one NFC chip found. |
idCardCanNotIdentify | ID card could not be identified. |
nfcTagNotValid | NFC tag is not valid. |
imageDataNotFound | Image data could not be retrieved. |
userCanceled | User cancelled the reading process. |
unknown | Unknown NFC error. |
Video Call Errors (TeydexError.VideoCallError)
| Case | Description |
|---|---|
closed | User closed the call. |
fail | Video call ended unsuccessfully. |
Timeout Errors (TeydexError.TimeOutError)
| Case | Description |
|---|---|
timeOut | The operation timed out. |
Server Errors (TeydexError.ServerError)
| Case | Description |
|---|---|
unknown | Unknown error communicating with the server. |
unexpected | Unexpected server error. |
Rejection Errors (TeydexError.RejectedError)
| Case | Description |
|---|---|
rejected | The operation was rejected. |
maxRetryCountExceeded | Maximum retry count exceeded. |
Identity Read Errors (TeydexError.IdentityReadFailedError)
| Case | Description |
|---|---|
identityReadFailed | Identity could not be read. |