Skip to main content
Version: 1.1.0

Teydex Android Document

This document contains all the necessary steps, usage examples, and platform-specific technical details for securely and smoothly integrating the Teydex library into the Android platform.

Version Requirements

To use the Teydex Android library smoothly, you need to check your versions.

PlatformMin version
AndroidminSdkVersion: 24
compileSdkVersion: 34
targetSdkVersion: 34
kotlinVersion: 1.8.0

Android Gradle Configuration

You need to add the following configuration along with the GitLab token in the repository definitions under Settings.gradle. Ensure that you enter the necessary credentials for repository access correctly.

{
maven {
isAllowInsecureProtocol = true
name = "GitLab"
url = uri("<REPO_URL>")
credentials(HttpHeaderCredentials::class) {
name = "Private-Token"
value = "GITLAB_TOKEN"
}
authentication {
create<HttpHeaderAuthentication>("header")
}
}
  • REPO_URL should be replaced with the URL provided to you.
  • Replace the PRIVATE_TOKEN field with the personal access token provided by your organization.
  • The allowInsecureProtocol = true setting should only be used in secure networks or on internal private servers.

Gradle Configuration

Add the following lines to your android/app/build.gradle file:

implementation("com.innovance:kyc:1.1.0")

The following dependencies must be defined at the minimum specified versions in your project's android/build.gradle file. Using lower versions may result in compilation or runtime errors related to the library.

buildscript {
dependencies {
classpath("com.android.tools.build:gradle:7.4.2") // Minimum supported version: 7.4.2
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:1.8.0" // Minimum supported version: 1.8.0
}
}

Info Screen

The Info screen in your KYC application refers to the informational pages displayed before the steps. Optionally, the following parameters can be added for each step.

Info Screen Features

ParameterTypeDescription
toolbarTitleStringSpecifies the text for the toolbar.
titleTextStringSpecifies the text for the title.
descriptionTextStringSpecifies the text for the description.
buttonTextStringSpecifies the text for the button that starts the step.
imageResId@RawRes IntSpecifies the image to be used.
lottieResId@RawRes IntSpecifies the Lottie animation.
bulletsList<String>Information about the next step can be presented in bullet points.
bulletIcon@RawRes IntSpecifies the icon for the bullet points.

Info Screen Usage

Below is an example of how to use the Info screen.


val frontInfo = buildInfo {
toolbarTitle("Kimlik Ön Yüz")
descriptionText("Lütfen aşağıdaki adımları dikkatlice takip ediniz:")
buttonText("Devam")
lottieResId(R.raw.front)
bullets(
listOf(
"Kimliğinizi Yerleştirin\n" +
"Kimliğinizin arka yüzünü, telefon ekranına paralel bir şekilde
tutun. Kimlik, ekranda görünen şablonun içine tam olarak yerleşecek
şekilde konumlandırılmalıdır.",
"Kimlik Bilgilerinin Görünürlüğü\n Kimlik üzerindeki tüm
bilgilerin net bir şekilde göründüğünden emin olun. Kimlik bilgileri
bulanık olmamalı ve kolayca okunabilir olmalıdır")
)
}

Step

The features to be used in all steps are specified in this section. These features are available in every step (Front, Back, Hologram, NFC, Liveness, Passport, VideoCall).

Step Features

ParameterTypeDescription
addInfoInfoUsed to add an Info screen to the corresponding step. It is optional.
toolbarTitleStringRepresents the text for the Toolbar to be displayed in the corresponding step.
toolbarRightCloseIconStringRepresents the exit icon to terminate the corresponding step.
toolbarLeftCloseIconStringRepresents the exit icon to terminate the corresponding step.
identifyTimeoutLongSpecifies the timeout duration for the corresponding step (ms). e.g., 10_000
stepInformationTextToSpeechStringSpecifies the voice guidance message.

Glare Detection

Starting with v1.1.0, Front, Back, Liveness, and Passport steps support glare detection to help users capture the document under suitable lighting conditions. When the environment is too bright, too dark, or when a glare is detected on the document, a warning message is displayed to the user on the related screen.

The following parameters are available on Front, Back, and Passport steps:

ParameterTypeDescription
isGlareDetectionEnableBooleanEnables glare detection for the corresponding step. Default is true for Front and Back, and false for Passport.
glareDetectedTextStringWarning text shown when a glare is detected on the document.
tooBrightTextStringWarning text shown when the environment is too bright.
tooDarkTextStringWarning text shown when the environment is too dark.
multipleDocumentsDetectedTextStringWarning text shown when multiple documents are detected in the camera frame.

For the Liveness step, only ambient-light-related parameters are available:

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

If any of these parameters is not provided, the SDK falls back to the built-in default warning texts (Turkish).

Front Step Usage

      val front = buildFront {
identifyTimeout(30_000L)
addInfo(frontInfo)
toolbarTitle("Kimlik Ön Yüz")
toolbarRightCloseIcon(R.drawable.ic_close)
isGlareDetectionEnable(true)
glareDetectedText("Glare detected. Please hold the document at a different angle.")
tooBrightText("The environment is too bright. Please reduce the light.")
tooDarkText("The environment is too dark. Please move to a brighter area.")
multipleDocumentsDetectedText("Please show only one document.")
}

Back Step Usage

      val back = buildBack {
identifyTimeout(30_000L)
addInfo(backInfo)
toolbarTitle("Kimlik Arka Yüz")
toolbarRightCloseIcon(R.drawable.ic_close)
isGlareDetectionEnable(true)
glareDetectedText("Glare detected. Please hold the document at a different angle.")
tooBrightText("The environment is too bright. Please reduce the light.")
tooDarkText("The environment is too dark. Please move to a brighter area.")
multipleDocumentsDetectedText("Please show only one document.")
}

NFC Step Usage

     val nfc = buildNFC {
addInfo(nfcInfo)
toolbarRightCloseIcon(R.drawable.ic_close)
toolbarTitle("NFC")
}

Hologram Step Usage

     val hologram = buildHologram {
addInfo(hologramInfo)
toolbarTitle("Hologram")
}

Passport Step Usage

     val passport = buildPassport {
identifyTimeout(60_000L)
addInfo(passportInfo)
toolbarTitle("Passport")
toolbarRightCloseIcon(R.drawable.ic_close)
}

VideoCall Step Features

ParameterTypeDescription
splashScreenResourceId@DrawableRes IntUsed to define the splash screen displayed before VideoCall starts.
caution

Starting with v1.1.0, it is recommended to configure the VideoCall splash screen and external logo image via UIConfig. See the UIConfig section below.

VideoCall Step Usage

     val videoCall = buildVideoCall {
addInfo(videoCallInfo)
splashScreenResourceId(R.drawable.bg_splash)
}

Liveness Step Features

ParameterTypeDescription
rightTextStringThe command telling the user to look right for the liveness photo.
leftTextStringThe command telling the user to look left for the liveness photo.
upTextStringThe command telling the user to look up for the liveness photo.
downTextStringThe command telling the user to look down for the liveness photo.
centerYourFaceTextStringThe command telling the user to look directly (straight) at the camera for the liveness photo.
multipleFaceTextStringThe message informing the user when multiple faces are detected during the liveness step.
dotColor@ColorInt IntThe color of the dots indicating a completed command during the liveness step.
dotRadiusIntThe size (radius) of the dots indicating a completed command during the liveness step.
rightTextToSpeechStringThe voice command telling the user to look right for the liveness photo.
leftTextToSpeechStringThe voice command telling the user to look left for the liveness photo.
upTextToSpeechStringThe voice command telling the user to look up for the liveness photo.
downTextToSpeechStringThe voice command telling the user to look down for the liveness photo.
centerTextToSpeechStringThe voice command telling the user to look directly (straight) at the camera for the liveness photo.

Liveness Step Usage

    val liveness = buildLiveness {
dotColor(Color.Green.toArgb())
rightText("yüzünüzü sağa çeviriniz")
leftText("sola çeviriniz")
upText("yüzünüzü yukarı kaldırınız")
downText("aşağı yöne bakınız")
multipleFaceText("birden fazla yüz algılandı")
identifyTimeout(60_000)
addInfo(livenessInfo)
toolbarTitle("Liveness")
isGlareDetectionEnable(true)
tooBrightText("The environment is too bright. Please reduce the light.")
tooDarkText("The environment is too dark. Please move to a brighter area.")
}

UIConfig

Used to define the general design features to be used in the application.

UIConfig Features

ParameterTypeDescription
buttonColorIntUsed to specify the color of the button to be used in the application.
buttonTextColorIntUsed to specify the text color of the button to be used in the application.
bulletTextColorIntUsed to specify the text color of the bullet points.
buttonCornerRadiusIntUsed to specify the radius value of the button to be used in the application.
setVideoCallExternalLogoImage@DrawableRes IntAdded in v1.1.0. Specifies the external logo image to be displayed on the VideoCall screen.
setVideoCallSplashScreenImage@DrawableRes IntAdded in v1.1.0. Specifies the splash screen image displayed before VideoCall starts.

UIConfig Usage

    val uiConfig = buildUIConfig {
buttonColor(com.innovance.kyc.R.color.purple_700)
buttonCornerRadius(30)
buttonTextColor(com.innovance.kyc.R.color.purple_700)
bulletTextColor(R.color.teal_700)
setVideoCallExternalLogoImage(R.drawable.ic_logo_sample)
setVideoCallSplashScreenImage(R.drawable.ic_logo_sample)
}

KYC

This is the main function that will start the KYC process. All specified features are added here, and a KYC flow is initiated with the process function.

KYC Features

ParameterTypeDescription
baseUrlStringThe baseUrl to be used globally in the application, the URL from the on-premise server.
videoCallBaseUrlStringThe URL to be used for the VideoCall flow, the URL from the on-premise video call server.
addUIConfigUIConfigUsed to specify UI configuration features globally across the SDK.
showCompletedScreenBooleanSpecifies whether to display the success screen when all steps are successfully completed.
identifierStepsMutableList<Step>Ensures all steps are included in the system with the created features.
addClientTokenStringUsed to pass the client token required to initialize the SDK.
addApplicationIdStringUsed to pass the applicationId required to initialize the SDK.
addErrorMessagesHashMap<KYCErrorString>Used to display custom error messages in the SDK.
onEventKYCEventCan be used to forward events from the SDK to third-party analytics tools like Firebase, Mixpanel, or Countly.
onErrorKYCErrorCan be used to log error messages generated by the SDK.
onCompletionBooleanProvides a flag to check the status after the flow is successfully completed and the relevant service is redirected.
shouldGetCustomerLocationBooleanSpecifies whether the user's location information should be collected.
sslPinsList<String>Used to add the necessary sha256 keys for SSL pinning.
processContextUsed to initialize the SDK for a KYC flow with the specified features.

KYC Usage

    val kyc = buildKYC {
addUIConfig(uiConfig)
showCompletedScreen(true)
identifierSteps(mutableListOf(front,hologram,back,nfc,liveness,passport,videoCall))
addClientToken(AppSharedPref.getClientToken(context))
addApplicationId(AppSharedPref.getAppId(context))
addErrorMessages(hashMapOf(
KYCNFCError.NOT_ENABLE to "not enable",
KYCCameraError.FLASH_MODE to " flash mode"))
onEvent { Log.i("TEST_LOG", "KYC Event:${it.name}")}
onError { Log.i("TEST_LOG", "KYC Error:${it.type} - ${it.message}")}
onCompletion { Log.i("TEST_LOG", "KYC Completed")}}}
kyc.process(context)

KYCError

The type and descriptions of errors that may come from the SDK can be accessed here. Error messages that need to be changed can be modified using addErrorMessages in the form of KYCError,String. For example: KYCCameraError.FLASH_MODE to "flash mode".

ParameterDescription
UNKNOWNBilinmeyen hata
FIRST_STEP_UNDEFINEDİlk adım null olamaz!
APP_IDENTIFIER_STEPS_IS_NOT_SAME_APIUygulamada tanımladığınız adımlar ile API'de tanımladığınız adımların aynı olması gerekmektedir.

KYCCameraError

ParameterDescription
UNKNOWNBilinmeyen bir hata oluştu. Lütfen tekrar deneyin.
PERMISSION_NOT_GRANTEDKamera izinleri verilmedi. Lütfen kamera izinlerinizi veriniz.
CAMERA_PERMISSION_REQUIREDKamera izni gerekli. Lütfen kamera izni veriniz.
CAMERA_PERMISSION_PERMANENTLY_DENIEDKamera izni kalıcı olarak reddedildi. Lütfen ayarlardan kamera izni veriniz.
RECORD_AUDIO_REQUIREDSes kaydı izni gerekli. Lütfen ses kaydı izni veriniz.
RECORD_AUDIO_PERMANENTLY_DENIEDSes kaydı izni kalıcı olarak reddedildi. Lütfen ayarlardan ses kaydı izni veriniz.
CAMERA_SOURCE_PREVIEW_NOT_FOUNDKamera ön izlemesi oluşturulamadı. Lütfen tekrar deneyin.
CAMERA_SOURCE_NOT_FOUNDKamera bulunamadı. Lütfen kamerayı kontrol edin.
FLASH_MODEFlash aç/kapa işlemi sırasında bir hata oluştu. Lütfen tekrar deneyin.
VIDEO_WRITE_FAILEDVideo kaydedilirken bir hata oluştu. Lütfen tekrar deneyin.
VIDEO_READ_FAILEDVideo bulunamadı. Lütfen dosyanın varlığını kontrol edin.
VIDEO_EXECUTE_COMMAND_CANCELLED_BY_USERVideo düzenleme işlemi kullanıcı tarafından iptal edildi.
VIDEO_EXECUTE_COMMANDS_FAILEDVideo düzenleme işlemi başarısız oldu. Lütfen tekrar deneyin.
VIDEO_COMPRESS_FAILEDVideo sıkıştırma işlemi başarısız oldu. Lütfen tekrar deneyin.
CODEC_NOT_SUPPORTEDVideo düzenleme işlemi başarısız oldu. Lütfen tekrar deneyin.

KYCNFCError

ParameterDescription
UNKNOWNBilinmeyen bir hata oluştu. Lütfen tekrar deneyin.
DEVICE_NOT_HAVE_NFCCihazda NFC modülü bulunmuyor. Bu özellik yalnızca NFC destekli cihazlarda çalışır.
DISABLE_NFC_ADAPTERNFC modülü devre dışı bırakılırken bir hata oluştu. Lütfen NFC'yi tekrar etkinleştirin.
NOT_ENABLENFC modülü aktif değil. Lütfen NFC'yi etkinleştirin.
NOT_DISCOVEREDNFC açıkken kimlik taranamadı. Lütfen kimliği tekrar yaklaştırın.
TAG_NOT_SUPPORTEDKimlik bilgisi desteklenmiyor. Bu kimlik kartı desteklenmemektedir.
TAG_LOSTKimlik bilgisi okunamadı. Lütfen kimliği tekrar yaklaştırın.
ISODEP_NOT_FOUNDKimlik bilgisi okunamadı. Lütfen kimliği tekrar yaklaştırın.
PASSIVE_AUTH_FAILEDKimlik bilgisi algılanamadı. Lütfen geçerli bir kimlik kullanın.
PHOTO_NOT_FOUNDKimlik kartında fotoğraf bilgisi yok. Lütfen geçerli bir kimlik kullanın.
PERSON_DETAIL_NOT_FOUNDKişi bilgisine ihtiyaç var. Lütfen kimliği doğru yerleştirin.
CARD_AUTH_FAILEDKimlik bilgileri tanımlanamadı.
WRONG_MRZ_STRINGMRZ bilgisi algılanamadı. Lütfen kimliği tekrar yaklaştırın.