Android Ionic Capacitor Wrapper
-
Setup the Ionic development environment based on the development and target OS by following the steps here,
Setting up the development environment Github Repository -
We will be integrating Android Identity SDK version 9.3.10.2.9. Download and unzip the resources archive, it consists of the ionic-angular, android_resources and android_code directories, IonicSDK2AndroidResources
-
Create an empty Ionic Angular application
ionic start ionic-angular-capacitor-identity-sdk blank --type=angular
-
Add ionic angular code. Copy and paste the contents of the ionic-angular folder to the home folder. Overwrite files if required.
-
Add android project. Build and sync code.
ionic cap add android
ionic build
ionic cap sync
- Open android directory in Android Studio
ionic cap open android
-
Add Android code. Add files from android_code directory. Replace main build.gradle file from android_resources directory. Overwrite files if required.
-
Add following property to manifest node in manifest file,
xmlns:tools="http://schemas.android.com/tools"
- Add following property to application node in manifest file,
tools:replace="android:name,android:allowBackup"
- Add following activity declaration in application node in manifest file,
<activity android:name="io.ionic.starter.CallPluginActivity"/>
- Add following plugins on the top of the app project’s build.gradle file,
apply plugin: "com.android.application"
apply plugin: 'kotlin-android'
- Modify the following in the app project’s build.gradle file,
compileSdkVersion 32
buildToolsVersion "30.0.3"
minSdkVersion 23
targetSdkVersion 32
- Add following nodes in android node in the app project’s build.gradle file,
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
aaptOptions {
noCompress "tflite"
}
packagingOptions {
pickFirst '**/*.so'
}
- Add following dependencies in the app project’s build.gradle file,
implementation "androidx.appcompat:appcompat:1.3.1"
implementation 'com.idmission.sdk2:idmission-sdk:9.3.10.2.9'
-
Sync Now and Build in Android Studio
-
Run the android app
- Ionic sample app Download link
- Here is a brief description of the sample app functionality,
- ID Validation - Initiates ID Validation(Service ID 20) flow.
- ID Validation and Match Face - Initiates ID Validation and Match Face(Service ID 10) flow.
- ID Validation and Customer Enroll - Initiates ID Validation and Customer Enroll(Service ID 50) flow.
- Customer Enroll Biometrics - Initiates Customer Enroll Biometrics(Service ID 175) flow.
- Customer Verification - Initiates Customer Verification(Service ID 105) flow.
- Identify Customer - Initiates Identify Customer(Service ID 185) flow.
- Live Face Check - Initiates Live Face Check(Service ID 660) flow.
- Submit - Submits the form.