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.
| Platform | Min version |
|---|---|
| Android | minSdkVersion: 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 = truesetting 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
| Parameter | Type | Description |
|---|---|---|
| addInfo | Info | Used to add an Info screen to the corresponding step. It is optional. |
| toolbarTitle | String | Represents the text for the Toolbar to be displayed in the corresponding step. |
| toolbarRightCloseIcon | String | Represents the exit icon to terminate the corresponding step. |
| toolbarLeftCloseIcon | String | Represents the exit icon to terminate the corresponding step. |
| identifyTimeout | Long | Specifies 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
| Parameter | Type | Description |
|---|---|---|
| splashScreenResourceId | @DrawableRes Int | VideoCall 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
| Parameter | Type | Description |
|---|---|---|
| rightText | String | The command telling the user to look right for the liveness photo. |
| leftText | String | The command telling the user to look left for the liveness photo. |
| upText | String | The command telling the user to look up for the liveness photo. |
| downText | String | The command telling the user to look down for the liveness photo. |
| centerYourFaceText | String | The command telling the user to look directly (straight) at the camera for the liveness photo. |
| multipleFaceText | String | The message informing the user when multiple faces are detected during the liveness step. |
| dotColor | @ColorInt Int | The color of the dots indicating a completed command during the liveness step. |
| dotRadius | Int | The 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
| Parameter | Type | Description |
|---|---|---|
| buttonColor | Int | Used to specify the color of the button to be used in the application. |
| buttonTextColor | Int | Used to specify the text color of the button to be used in the application SDK. |
| bulletTextColor | Int | Used to specify the text color of the bullet points. |
| buttonCornerRadius | Int | Used 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
| Parameter | Type | Description |
|---|---|---|
| baseUrl | String | The baseUrl to be used globally in the application, the URL from the on-premise server. |
| videoCallBaseUrl | String | The URL to be used for the VideoCall flow, the URL from the on-premise video call server. |
| addUIConfig | UIConfig | Used to specify UI configuration features globally across the SDK. |
| showCompletedScreen | Boolean | Specifies whether to display the success screen when all steps are successfully completed. |
| identifierSteps | MutableList<Step> | Ensures all steps are included in the system with the created features. |
| addClientToken | String | Used to pass the client token required to initialize the SDK. |
| addApplicationId | String | Used to pass the applicationId required to initialize the SDK. |
| addErrorMessages | HashMap<KYCErrorString> | Used to display custom error messages in the SDK. |
| onEvent | KYCEvent | Can be used to forward events from the SDK to third-party analytics tools like Firebase, Mixpanel, or Countly. |
| onError | KYCError | Can be used to log error messages generated by the SDK. |
| onCompletion | Boolean | Provides a flag to check the status after the flow is successfully completed and the relevant service is redirected. |
| shouldGetCustomerLocation | Boolean | Specifies whether the user's location information should be collected. |
| sslPins | List<String> | Used to add the necessary sha256 keys for SSL pinning. |
| process | Context | Used 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".
| Parameter | Description |
|---|---|
| UNKNOWN | Bilinmeyen hata |
| FIRST_STEP_UNDEFINED | İlk adım null olamaz! |
| APP_IDENTIFIER_STEPS_IS_NOT_SAME_API | Uygulamada tanımladığınız adımlar ile API'de tanımladığınız adımların aynı olması gerekmektedir. |
KYCCameraError
| Parameter | Description |
|---|---|
| UNKNOWN | Bilinmeyen bir hata oluştu. Lütfen tekrar deneyin. |
| PERMISSION_NOT_GRANTED | Kamera izinleri verilmedi. Lütfen kamera izinlerinizi veriniz. |
| CAMERA_PERMISSION_REQUIRED | Kamera izni gerekli. Lütfen kamera izni veriniz. |
| CAMERA_PERMISSION_PERMANENTLY_DENIED | Kamera izni kalıcı olarak reddedildi. Lütfen ayarlardan kamera izni veriniz. |
| RECORD_AUDIO_REQUIRED | Ses kaydı izni gerekli. Lütfen ses kaydı izni veriniz. |
| RECORD_AUDIO_PERMANENTLY_DENIED | Ses kaydı izni kalıcı olarak reddedildi. Lütfen ayarlardan ses kaydı izni veriniz. |
| CAMERA_SOURCE_PREVIEW_NOT_FOUND | Kamera ön izlemesi oluşturulamadı. Lütfen tekrar deneyin. |
| CAMERA_SOURCE_NOT_FOUND | Kamera bulunamadı. Lütfen kamerayı kontrol edin. |
| FLASH_MODE | Flash aç/kapa işlemi sırasında bir hata oluştu. Lütfen tekrar deneyin. |
| VIDEO_WRITE_FAILED | Video kaydedilirken bir hata oluştu. Lütfen tekrar deneyin. |
| VIDEO_READ_FAILED | Video bulunamadı. Lütfen dosyanın varlığını kontrol edin. |
| VIDEO_EXECUTE_COMMAND_CANCELLED_BY_USER | Video düzenleme işlemi kullanıcı tarafından iptal edildi. |
| VIDEO_EXECUTE_COMMANDS_FAILED | Video düzenleme işlemi başarısız oldu. Lütfen tekrar deneyin. |
| VIDEO_COMPRESS_FAILED | Video sıkıştırma işlemi başarısız oldu. Lütfen tekrar deneyin. |
| CODEC_NOT_SUPPORTED | Video düzenleme işlemi başarısız oldu. Lütfen tekrar deneyin. |
KYCNFCError
| Parameter | Parameter |
|---|---|
| UNKNOWN | Bilinmeyen bir hata oluştu. Lütfen tekrar deneyin. |
| DEVICE_NOT_HAVE_NFC | Cihazda NFC modülü bulunmuyor. Bu özellik yalnızca NFC destekli cihazlarda çalışır. |
| DISABLE_NFC_ADAPTER | NFC modülü devre dışı bırakılırken bir hata oluştu. Lütfen NFC'yi tekrar etkinleştirin. |
| NOT_ENABLE | NFC modülü aktif değil. Lütfen NFC'yi etkinleştirin. |
| NOT_DISCOVERED | NFC açıkken kimlik taranamadı. Lütfen kimliği tekrar yaklaştırın. |
| TAG_NOT_SUPPORTED | Kimlik bilgisi desteklenmiyor. Bu kimlik kartı desteklenmemektedir. |
| TAG_LOST | Kimlik bilgisi okunamadı. Lütfen kimliği tekrar yaklaştırın. |
| ISODEP_NOT_FOUND | Kimlik bilgisi okunamadı. Lütfen kimliği tekrar yaklaştırın. |
| PASSIVE_AUTH_FAILED | Kimlik bilgisi algılanamadı. Lütfen geçerli bir kimlik kullanın. |
| PHOTO_NOT_FOUND | Kimlik kartında fotoğraf bilgisi yok. Lütfen geçerli bir kimlik kullanın. |
| PERSON_DETAIL_NOT_FOUND | Kişi bilgisine ihtiyaç var. Lütfen kimliği doğru yerleştirin. |
| CARD_AUTH_FAILED | Kimlik bilgileri tanımlanamadı. |
| WRONG_MRZ_STRING | MRZ bilgisi algılanamadı. Lütfen kimliği tekrar yaklaştırın. |