πŸ“±eNROLL Android SDK

This document is a guide for eNROLL Android SDK. In addition, following the below steps will help you learn how to add and use (eNROLL SDK) in your Android Application.

REQUIREMENTS

  • Minimum Android SDK 24

  • Target API level 35

  • Kotlin Version 2.1.0

2. INSTALLATION

1- Add eNROLL SDK dependency to the build.gradle (Module :app) file:

dependencies {
    implementation("com.github.LuminSoft:eNROLL-Android:latest")
}
  • You can find the latest version https://github.com/LuminSoft/eNROLL-Android/releases

2- Add Maven Repository in settings.gradle file

dependencyResolutionManagement {
    repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
    repositories {
        google()
        mavenCentral()
        maven {
            url = uri("http://maven.innovatrics.com/releases")
            isAllowInsecureProtocol = true
        }
        maven {
            url = uri("https://jitpack.io")
        }
    }
}

3- Add license file to your project:

App Screenshot

3. IMPORT

import com.luminsoft.enroll_sdk.*

4. USAGE

Step 1: Initialize the SDK and create a callback object:

ℹ️ eNROLL.init function is used for Initializing eNROLL SDK instance to use it.

ℹ️ It’s a throws function so please put it in a try…catch blocs.

ℹ️ EnrollCallback object contains Success, Error and Get Request ID call backs

        try {
            eNROLL.init(
                tenantId = "tenantId",
                tenantSecret = "tenantSecret",
                enrollMode = EnrollMode.ONBOARDING,
                environment = EnrollEnvironment.STAGING,
                enrollCallback = object :
                    EnrollCallback {
                    override fun success(enrollSuccessModel: EnrollSuccessModel) {
                       Log.d(TAG, enrollSuccessModel.enrollMessage)
                    }

                    override fun error(enrollFailedModel: EnrollFailedModel) {
                        Log.d(TAG, enrollFailedModel.failureMessage)
                    }

                    override fun getRequestId(requestId: String) {
                        Log.d(TAG, requestId)
                    }
                },
                localizationCode = LocalizationCode.EN,
                googleApiKey = "googleApiKey",
                skipTutorial = false,
                appColors = AppColors(),
                applicantId = "applicationIdText",
                levelOfTrustToken = "levelOfTrustTokenText",
                correlationId = "correlationId",
                fontResource = R.font.itim_regular,
                enrollForcedDocumentType = EnrollForcedDocumentType.NATIONAL_ID_OR_PASSPORT,
                templateId = "templateId",
                contractParameters = "contractParameters"
                )
        } catch (e: Exception) {
            Log.e("error", e.toString())
        }

Step 2: launch SDK:

eNROLL.launch function is used for launching eNROLL SDK.

ℹ️ It’s a throws function so please put it in a try…catch blocs.

try {
    eNROLL.launch(this)
} catch (e: Exception) {
    Log.e(TAG, e.toString())
}

5. VALUES DESCRIPTION

.

Keys.
Values

tenantId

Required. Write your organization tenant id

tenantSecret

Required. Write your organization tenant secret.

enrollMode

Required. Mode of the SDK.

environment

Required. Select the EnrollEnvironment: EnrollEnvironment.STAGING for staging and EnrollEnvironment.PRODUCTION for production.

enrollCallback

Required. Callback function to receive success and error response.

localizationCode

Required. Select your language code LocalizationCode.EN for English, and LocalizationCode.AR for Arabic. The default value is English.

googleApiKey

Optional. Google Api Key to view the user current location on the map.

applicantId

Optional. Write your Application id.

levelOfTrustToken

Optional. Write your Organization level of trust.

skipTutorial

Optional. Choose to ignore the tutorial or not.

appColors

Optional. Collection of the app colors that you could override like (primary - secondary - backGround - successColor - warningColor - errorColor - textColor).

correlationId

Optional. Correlation ID to connect your User ID with our Request ID

fontResource

Optional. Font Resource to set your font family

templateId

Optional. The ID of the contract to be signed.

contractParameters

Optional. Extra contract parameters

6. SECURITY NOTES

  • Never hardcode tenantSecret, levelOfTrustToken, or API keys inside the mobile application. Use a secure storage mechanism or fetch them from your backend securely.

  • Do not log sensitive user data (IDs, secrets, tokens) in production environments.

  • Regularly update the SDK to the latest stable version for security patches.