Skip to main content
Before using any of the SDK’s functionalities, you must create an SDK instance. The SDK uses an instance-based approach that provides better resource management and lifecycle control.
Deprecated API Notice — The static SDK singleton API is deprecated and will be removed in a future version. Please migrate to the new instance-based UaeKycSdk API documented below. The deprecated API is maintained only for backward compatibility.
Create an SDK instance using UaeKycSdk.create(applicationContext) in your Activity. The SDK implements AutoCloseable, so ensure you call close() when done to release native resources. Key differences from the deprecated API:
  • No separate initialization step — create the instance where you need it
  • Domain is passed to startJourney() instead of at initialization
  • SSL pinning has been removed entirely
  • Instance-based lifecycle management
import androidx.activity.ComponentActivity
import ae.gov.icp.uaekyc.UaeKycSdk

class MainActivity : ComponentActivity() {
    private var sdk: UaeKycSdk? = null

    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)

        // Create an SDK instance
        sdk = UaeKycSdk.create(applicationContext)

        // Register callback, start journey, etc.
    }

    override fun onDestroy() {
        super.onDestroy()

        // Clean up SDK resources
        sdk?.close()
        sdk = null
    }
}

Deprecated API

Deprecated — The following SDK singleton API is deprecated. Use UaeKycSdk.create() instead as shown above.
The deprecated singleton API required calling SDK.initialize() in your Application class. This approach is no longer recommended.

SslPinConfig (Removed)

SSL pinning configuration has been removed from the SDK. Modern systems and certificate authorities provide sufficient security without manual certificate pinning.

Example Code (Deprecated)

import android.app.Application
import ae.gov.icp.uaekyc.SDK

// DEPRECATED: Use UaeKycSdk.create() in your Activity instead
class ClientApp : Application() {

    override fun onCreate() {
        super.onCreate()

        // Define your domain
        val domain = "your.domain.ae"

        // Initialize the SDK (deprecated - domain now passed to startJourney)
        SDK.initialize(domain, null)
    }

    override fun onTerminate() {
        super.onTerminate()

        // Clean up SDK resources
        SDK.close()
    }
}