To upgrade from earlier iPass versions to version 2.16, follow these steps...
Modify the settings.gradle file by replacing it with the following code snippet:
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") } } }
Update the dependency versions in the build.gradle file as follows:
implementation("com.github.yazanalqasem:iPass2.0NativeAndroidSDK:2.16") implementation("com.github.yazanalqasem:iPass2.0CoreAndroidSDK:2.16")
If you are using the pre-packaged database implementation, please use the database from the available databases.
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.16") implementation("com.github.yazanalqasem:iPass2.0CoreAndroidSDK:2.16")
Add these lines in your settings.gradle file
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") } } }
Add this snippet to build. gradle file in your project.
android { compileOptions { isCoreLibraryDesugaringEnabled = true } }
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" />
iPass supports On-Prem server integration. To use an on-prem server, provide the server URL in the serverUrl parameter.
To start the process user need to download the database. iPass sdk supports two type of database systems.
This type of database is bundled within the SDK itself. It is a pre-configured and read-only database that comes as part of the app's installation package. Since the database is local to the app, querying this database is generally faster, as it does not involve network latency. This is a custom database designed to meet specific requirements. If you need a custom database tailored to your needs, you can request one by contacting our support team at info@ipass-mena.com.
This type of database is not included in the initial app package but is instead downloaded from a remote server when the app is launched or when certain conditions are met. The server-side database can be updated independently of the app, allowing for more dynamic content and real-time data management. In this database downloading time depends on the internet speed.
DataBaseDownloading.initializePreProcessedDb(context = this, dbName = DatabaseType.FULL_DB, serverUrl = "http://192.168.19.421/", completion = object: InitializeDatabaseCompletion { override fun onProgressChanged(progress: Int) { //get progress } override fun onCompleted( status: Boolean, message: String? ) { if (status) { //proceed to next step } } })
DataBaseDownloading.initializeDynamicDb(context = this, serverUrl = "http://192.168.19.421/", completion = object: InitializeDatabaseCompletion { override fun onProgressChanged(progress: Int) { //get progress } override fun onCompleted( status: Boolean, message: String? ) { if (status) { //proceed to next step } } })
For authentication checks, you need to enable hologram option using the following code snippet. By default, this option is disabled:
configProperties.needHologramDetection(value = true)
iPassSDKManger.UserOnboardingProcess(context = this, email, password, object : ResultListener<AuthenticationResponse> { override fun onSuccess(response: AuthenticationResponse?) { val userToken = response?.user?.token!! } override fun onError(exception: String) { // error message } })
val getList: Array<HashMap<:String, String>> = iPassSDKManger.getWorkFlows()
iPassSDKManger.startScanningProcess( requireContext(), email, userToken, apptoken, socialMediaEmail, phoneNumber, workflowId, binding.root as ViewGroup) { status, message -> if (status) { getDocData(model.workflow) } else { Log.e("startScanningProcess", message) Toast.makeText(context,message,Toast.LENGTH_SHORT).show() } }
iPassSDKManger.getDocumentScannerData(requireContext(), apptoken, object : ResultListener<TransactionDetailResponse> { override fun onSuccess(response: TransactionDetailResponse?) { if (response?.Apistatus!!) { val data = response.data!! } } override fun onError(exception: String) { Toast.makeText(context, exception, Toast.LENGTH_SHORT).show() } })
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.16")
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.