Skip to main content
Version: 1.0.1

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.0.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

| Parameter | Type | Description |
|-----------------|------------------|----------------------------------------------------------------------------------------------|
| toolbarTitle | `String` | Specifies the text for the toolbar. |
| titleText | `String` | Specifies the text for the title. |
| descriptionText | `String` | Specifies the text for the description. |
| buttonText | `String` | Specifies the text for the button that starts the step. |
| imageResId | `@RawRes Int` | Specifies the image to be used. |
| lottieResId | `@RawRes Int` | Specifies the Lottie animation. |
| bullets | `List<String>` | Information about the next step can be presented in bullet points. |
| bulletIcon | `@RawRes Int` | Specifies the icon for the bullet points. |

### Info Screen Usage

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

``` kotlin

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, 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

Front Step Usage

      val front = buildFront {
identifyTimeout(30_000L)
addInfo(frontInfo)
toolbarTitle("Kimlik Ön Yüz")
toolbarRightCloseIcon(R.drawable.ic_close)
}

Back Step Usage

      val back = buildBack {
identifyTimeout(30_000L)
addInfo(backInfo)
toolbarTitle("Kimlik Arka Yüz")
toolbarRightCloseIcon(R.drawable.ic_close)
}

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")
}

VideoCall Step Features

ParameterTypeDescription
splashScreenResourceId@DrawableRes IntVideoCall başlamadan önce gösterilecek başlangıç ekranının rengini(Splash Screen) belirlemek için kullanılır.

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.

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")
}

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 SDK.
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.

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)
}

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,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

ParameterParameter
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.