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
MainActivity.kt
MainActivity.java
import androidx.activity.ComponentActivityimport ae.gov.icp.uaekyc.UaeKycSdkclass 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 }}
SSL pinning configuration has been removed from the SDK. Modern systems and certificate authorities provide sufficient security without manual certificate pinning.
import android.app.Applicationimport ae.gov.icp.uaekyc.SDK// DEPRECATED: Use UaeKycSdk.create() in your Activity insteadclass 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() }}
import android.app.Application;import ae.gov.icp.uaekyc.SDK;// DEPRECATED: Use UaeKycSdk.create() in your Activity insteadpublic class ClientApp extends Application { @Override public void onCreate() { super.onCreate(); // Define your domain final String domain = "your.domain.ae"; // Initialize the SDK (deprecated - domain now passed to startJourney) SDK.INSTANCE.initialize(domain, null); } @Override public void onTerminate() { super.onTerminate(); // Clean up SDK resources SDK.INSTANCE.close(); }}