Skip to main content
Version: 1.4.6

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.

PlatformMin version
iOSiOS 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

ParameterTypeDescription
setTitleTextStringSpecifies the title text to be displayed on the Info screen.
setDescriptionTextStringSpecifies the description text to be displayed on the Info screen.
setButtonTextStringSpecifies the text of the button that will start the step shown on the Info screen.
setAssetImageNameStringSpecifies the image to be shown on the Info screen.
setLottieFileNameStringSpecifies 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 IntCan be used to change the icon of bullet items displayed on the Info screen.
setCancelButtonIsActiveBoolEnables 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:

ParameterTypeDescription
isGlareDetectionEnableBoolEnables glare detection for the relevant step. Default is true for Front and Back, false for Passport.
glareDetectedTextStringText displayed when glare is detected on the document.
tooBrightTextStringWarning text displayed when the environment is too bright.
tooDarkTextStringWarning text displayed when the environment is too dark.
multipleDocumentsDetectedTextStringWarning text displayed when multiple documents are detected by the camera.

The Liveness step only has parameters related to ambient lighting:

ParameterTypeDescription
isGlareDetectionEnableBoolEnables ambient light monitoring in the Liveness step. Default is true.
tooBrightTextStringWarning text displayed when the environment is too bright.
tooDarkTextStringWarning text displayed when the environment is too dark.
note

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

ParameterTypeDescription
setInfoViewInfoUsed to add an Info screen to the relevant step. Optional.
setTitleStringRepresents the Toolbar text to be displayed in the relevant step.
setStepTypeStepTypeSpecifies the type of the step (.idcardFront, .idcardBack, etc.)
setStepInformationTextToSpeechStringRepresents the text to be read aloud at the beginning of the step.
setIdentifyTimeoutTimeIntervalSets the timeout duration for the relevant step. Default value is 30.
setIsGlareDetectionEnableBool?Enables glare detection.
setGlareDetectedTextString?Warning displayed when glare is detected.
setTooBrightTextString?Warning displayed when the environment is too bright.
setTooDarkTextString?Warning displayed when the environment is too dark.
setMultipleDocumentsDetectedTextString?Warning displayed when multiple documents are detected.

Liveness Step Properties

ParameterTypeDescription
setDirectionTextToSpeechString, String, String, String, StringSets 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: setGlareDetectedText and setMultipleDocumentsDetectedText are not supported in the Liveness step; only tooBrightText and tooDarkText are 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

ParameterTypeDescription
dotRadiusCGFloat?Specifies the radius of the dots displayed on screen during the liveness check.
dotColorUIColor?Defines the default color of the dots used as liveness indicators.
activeDotColorUIColor?Sets the color of the active dot during the liveness check.
titleTextString?The main title text displayed during the liveness check.
upTextString?Instruction text displayed when the user needs to move their head upward.
downTextString?Instruction text displayed when the user needs to move their head downward.
leftTextString?Instruction text displayed when the user needs to turn their head to the left.
rightTextString?Instruction text displayed when the user needs to turn their head to the right.
centerYourFaceTextString?Instruction text asking the user to center their face within the frame.
faceNotDetectedTextString?Message displayed when the user's face is not detected during the liveness check.
overlayTextString?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

ParameterTypeDescription
colorsColorsConfig?Used to configure the color settings for Info screens and bottom sheets.
typographyTypographyConfig?Used to configure the font family, font sizes, and font weights to be used throughout the SDK.
shapesShapesConfig?Used to configure the shape settings for Info screens and bottom sheets.
bulletIconNameString?Specifies the name of the icon used for bullet points in Info screens and bottom sheets.
textConfigTextConfig?Used to customize the button texts on the photo approval screen.

ColorsConfig Properties

ParameterTypeDescription
buttonColorUIColor?Specifies the background color of buttons displayed in Info screens and bottom sheets.
buttonTextColorUIColor?Sets the text color of buttons displayed in Info screens and bottom sheets.
bulletTextColorUIColor?Defines the color of bulleted texts in Info screens and bottom sheets.
titleColorUIColor?Defines the color of the title text on Info screens.
descriptionColorUIColor?Defines the color of the description text on Info screens.

ShapesConfig Properties

ParameterTypeDescription
buttonCornerRadiusInt?Sets the corner radius of buttons for styling purposes.

TextConfig Properties

ParameterTypeDescription
approveButtonTextString?Text of the approve button shown after a photo is captured.
retakeButtonTextString?Text of the retake button shown after a photo is captured.

TypographyConfig Properties

ParameterTypeDescription
fontFamilyString?Specifies the font family name to be used throughout the SDK. Example: "Inter", "Inter-Regular", "Roboto".
titleFontSizeCGFloatSpecifies the font size to be used in title texts. Default value: 28.
bodyFontSizeCGFloatSpecifies the font size to be used in body texts. Default value: 16.
buttonFontSizeCGFloatSpecifies the font size to be used in button texts. Default value: 16.
labelFontSizeCGFloatSpecifies the font size to be used in small helper label texts and light condition warnings. Default value: 14.
timerFontSizeCGFloatSpecifies the font size to be used in timer texts. Default value: 32.
titleFontWeightIntSpecifies the font weight to be used in title texts. Supported values: 100, 400, 500, 700, 900. Default value: 700.
bodyFontWeightIntSpecifies 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

ParameterTypeDescription
showCompletedScreenBoolControls 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.
videoCallSplashScreenAssetNameStringUsed to customize the full-screen image displayed when the video call screen opens.
closeIconAssetNameStringUsed to customize the image used for the close button in Info screens.
livenessConfigLivenessConfigUsed to customize the instructions in the Liveness step.
uiConfigUIConfig?Used to customize the instructions in the Info screen and bottom sheet.
ttsConfigTTSConfigUsed for customization of the text-to-speech feature.
videoCallExternalLogoImageUIImageUsed 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:

CaseDescription
.successfulAll 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 from parameter must be given a UINavigationController or a UIViewController that has a navigationController.

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)

CaseDescription
cameraPermissionDeniedCamera permission was denied.
cameraPermissionPermenantlyDeniedCamera permission was permanently denied.
deviceNotHaveCameraFeatureNo camera found on the device.
deviceInitFailedCamera could not be initialized.
flashModeError turning flash on/off.
capturePhotoFailedAn error occurred while taking a photo.
videoRecordingFaildAn error occurred while recording video.
vidoConfigurationFaildCamera preview could not be created.
videoDeleteFaildTemporary video could not be deleted.
unknownUnknown camera error.

NFC Errors (TeydexError.NFCError)

CaseDescription
deviceNotHaveNfcThe device does not have an NFC module.
nfcDisabledNFC is disabled.
nfcReadFailedID information could not be read.
nfcTagLostID connection was lost during reading.
nfcTagNotSupportedID card is not supported.
nfcTagNotSupportIsoDepNFC chip is not supported.
cantConnectNfcTagCould not connect to NFC tag.
wrongMrzStringMRZ information could not be verified.
externalAuthFailedExternal authentication failed.
passiveAuthFailedPassive authentication failed.
moreThanOneTagFoundMore than one NFC chip found.
idCardCanNotIdentifyID card could not be identified.
nfcTagNotValidNFC tag is not valid.
imageDataNotFoundImage data could not be retrieved.
userCanceledUser cancelled the reading process.
unknownUnknown NFC error.

Video Call Errors (TeydexError.VideoCallError)

CaseDescription
closedUser closed the call.
failVideo call ended unsuccessfully.

Timeout Errors (TeydexError.TimeOutError)

CaseDescription
timeOutThe operation timed out.

Server Errors (TeydexError.ServerError)

CaseDescription
unknownUnknown error communicating with the server.
unexpectedUnexpected server error.

Rejection Errors (TeydexError.RejectedError)

CaseDescription
rejectedThe operation was rejected.
maxRetryCountExceededMaximum retry count exceeded.

Identity Read Errors (TeydexError.IdentityReadFailedError)

CaseDescription
identityReadFailedIdentity could not be read.