To explain how a user can use the iPass SDK framework in steps, you can outline the process as follows:
In this step User Will add the IPass SDK inside the app's gradle file:
implementation("com.github.yazanalqasem:iPass2.0NativeAndroidSDK:2.12") implementation("com.github.yazanalqasem:iPass2.0CoreAndroidSDK:2.1")
dependencyResolutionManagement { repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS) repositories { google() mavenCentral() maven { url = uri("https://jitpack.io") } maven { url =uri("https://maven.regulaforensics.com/RegulaDocumentReader/Beta") } } }
In this step user will give required permissions in manifest file to enable the necessary device features:
<uses-permission android:name="android.permission.INTERNET" /> <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" /> <uses-permission android:name="android.permission.CAMERA" /> <uses-feature android:name="android.hardware.camera" /> <uses-feature android:name="android.hardware.camera.autofocus" /> <uses-permission android:name="android.permission.NFC" />
This method is used to setup database. It will download necessary files required for processing.
DataBaseDownloading.initialization(this, object: InitializeDatabaseCompletion { override fun onProgressChanged(progress: Int) { // get progress } override fun onCompleted( status: Boolean, message: String? ) { if (status) { // Show message } else { // Show error message } } })
This method verifies the account credentials and returns a Authorization token which is valid for 30 minutes. This token is required in next steps for authorization.
iPassSDKManger.UserOnboardingProcess(context, email, password, object : ResultListener<AuthenticationResponse> { override fun onSuccess(response: AuthenticationResponse?) { val authToken = response?.user?.token!! // Get auth token } override fun onError(exception: String) { // show error message } })
This method returns list of scenarios available.
fun getScenariosList() { val list = arrayListOf(Scenarios.SCENARIO_FULL_PROCESS, // (10031) Scenarios.ID_VERIFICATION_LIVENESS_AML, // (10032) Scenarios.ID_VERIFICATION_AML, // (10015) Scenarios.ID_VERIFICATION_LIVENESS,) // (10011) }
This method opens the scanner to scan the document. It uploads the document on server for processing the data.
iPassSDKManger.startScanningProcess(requireContext(), email, userToken, apptoken, socialMediaEmail, phoneNumber, flowId, ViewGroup) { status, message -> if (status) { // show success message } else { // show error message message } }
This Method Returns data scanned from Documents.
iPassSDKManger.getDocumentScannerData(requireContext(), apptoken, object : ResultListener<TransactionDetailResponse> { override fun onSuccess(response: TransactionDetailResponse?) { if (response?.Apistatus!!) { // Get Document Scanner Data } else { // Show error } } override fun onError(exception: String) { // Show error } })
Enable Hologram Detection
configProperties.needHologramDetection(true)
Disable Hologram Detection
configProperties.needHologramDetection(false)
SDK will support these languages Once language will change from android device settings or app language is changed
To reduce the APK size, follow these steps:
Now add the below mentioned line in the dynamic module's (iPassSdk) build gradle file and sync project.
implementation("com.github.yazanalqasem:iPass2.0CoreAndroidSDK:2.1")
Note : Remove this line from app's build gradle file
Add these lines in your activity
private var splitInstallManager: SplitInstallManager? = null splitInstallManager = SplitInstallManagerFactory.create(this) val request = SplitInstallRequest.newBuilder() .addModule(name) .build() splitInstallManager?.startInstall(request) ?.addOnSuccessListener { // Packages Installed (Initialise Database Here) } ?.addOnFailureListener { // Packages Installation failed! }
Configuring Webhook URL in Your iPass Account
Your iPass account can be set up to send an HTTP POST request with JSON data to a specified URL upon the completion of an onboarding process. This URL can be configured in the account profile section of the iPass web application.
Steps to Configure the Webhook URL:
We also provide the webhook signature verification here are the instructions to generate the signature in the node js.
const generateSignature = (uid, secret) => { return crypto.createHmac('sha256', secret) .update(JSON.stringify(uid)) .digest('hex'); };
const uid = { uid(uid that will sent you on webhook eg:ad962a61-6dcb-49cd-a863-353b1a5342cc) }; const secretKey = 'secret-key which we share you securely'; const signature = generateSignature(uid, secretKey);
From our side you can get the signature in the headers of webhook.