πŸ“±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.

1. REQUIREMENTS

  • Minimum Android SDK 24

  • Target API level 35

2. INSTALLATION

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

dependencies {
    implementation("com.github.LuminSoft:eNROLL-Android:latest")
}

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:

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)
                       Log.d(TAG, enrollSuccessModel.documentId)
                    }

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

Write your organization tenant id. (Required)

tenantSecret

Write your organization tenant sercet. (Required)

enrollMode

ONBOARDING, AUTH, UPDATE or FORGET_PROFILE_DATA (Required)

environment

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

enrollCallback

Callback function to receive success and error response. (Required)

localizationCode

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

googleApiKey

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

applicantId

Write your Application id. (Optional)

levelOfTrustToken

Write your Organization level of trust. (Optional)

skipTutorial

Choose to ignore the tutorial or not. (Optional)

appColors

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

correlationId

Correlation ID to connect your User ID with our Request ID (Optional)

fontResource

Font Resource to set your font family (Optional)

Last updated