- Add it in your root build.gradle at the end of repositories:
allprojects {
repositories {
...
maven { url 'https://jitpack.io' }
}
}
plugins {
id 'com.android.application' version '8.7.1' apply false
id 'com.android.library' version '8.7.1' apply false
id 'org.jetbrains.kotlin.android' version '1.9.20' apply false
id 'androidx.navigation.safeargs' version '2.8.3' apply false
id 'com.google.gms.google-services' version '4.3.10' apply false
}
- Add the dependency:
plugins {
id 'com.android.application'
id 'com.google.gms.google-services'
id 'org.jetbrains.kotlin.android'
id 'kotlin-kapt'
}
android {
...
buildFeatures {
viewBinding true
dataBinding true
}
}
dependencies {
implementation 'com.github.digio-tech:gateway:v4.0.15'
implementation 'com.github.digio-tech:gateway_esign:v4.0.17'
implementation 'com.github.digio-tech:protean-esign:v3.2'
implementation 'com.github.digio-tech:cvl_esign:v1.0.1'
implementation 'com.github.digio-tech:cvl_rdservice:v1.0.0'
// Other dependencies
implementation 'androidx.appcompat:appcompat:1.6.1'
implementation 'com.google.android.material:material:1.9.0'
implementation 'androidx.navigation:navigation-fragment-ktx:2.5.3'
implementation 'androidx.navigation:navigation-ui-ktx:2.5.3'
// Added in version 4.0.6
implementation 'androidx.swiperefreshlayout:swiperefreshlayout:1.1.0'
Following dependency is also not required if org.jetbrains.kotlin.android plugin version is 1.8.*
implementation 'androidx.core:core-ktx:1.10.0'
implementation 'com.android.volley:volley:1.2.1'
implementation 'com.scottyab:rootbeer-lib:0.1.0'
implementation 'com.google.code.gson:gson:2.9.1'
implementation 'com.squareup.okhttp3:okhttp:4.10.0'
implementation 'com.squareup.okhttp3:logging-interceptor:4.10.0'
}
- After updating dependencies click File => Sync Project with Gradle Files
Digio SDK supports android version 5.0 and above (SDK level 21 above)
- Finger print/ IRIS / FACE authentication required following software
- RD services software must be installed in device (Provided by vendor)
- For face based authentication on SANDBOX environment use the following apk from the given link. https://digio-public-docs.s3.ap-south-1.amazonaws.com/esign/rd_service/facerd_v0.7.43_pre_prod.apk On PRODUCTION - app will be redirected to play store to install necessary RD Service.
Note - For hybrid applications, you need to create a channel/bridge/plugin to communicate with the native SDK.
- Configure Digio instances : should be called on activity/fragment onCreate
Digio digio = new Digio();
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
DigioConfig digioConfig = new DigioConfig();
DigioTheme theme = new DigioTheme();
theme.setPrimaryColor(android.R.color.holo_red_dark);
theme.setFontFamily("Unbounded");
theme.setSecondaryColorHex("#141414");
theme.setFontUrl("https://fonts.googleapis.com/css2?family=Unbounded:wght@200&display=swap");
digioConfig.setTheme(theme);
digioConfig.setLogo("https://www.digio.in/images/digio_blue.png"); // Your company logo url
digioConfig.setEnvironment(DigioEnvironment.SANDBOX); // SANDBOX or PRODUCTION
digioConfig.setServiceMode(DigioServiceMode.OTP); // FP/OTP/IRIS/FACE
try {
digio.init(this, digioConfig);
} catch (Exception e) {
e.printStackTrace();
}
}
- DigioResponseListener and import onDigioSuccess, onDigioFailure override function in your activity/fragment. Below are function signatures
@Override
public void onDigioSuccess(@NonNull DigioResponse digioResponse) {
System.out.println("digioResponse = " + digioResponse);
}
@Override
public void onDigioFailure(@NonNull DigioResponse digioResponse) {
System.out.println("digioResponse = " + digioResponse);
}
@Override
public void onGatewayEvent(@NonNull GatewayEvent gatewayEvent) {
System.out.println("gatewayEvent = " + gatewayEvent);
}
- Starting the sign flow
try {
digio.start(signForm.getDocumentId(), signForm.getEmail()); //this refers DigioResponseListener
} catch (Exception e) {
e.printStackTrace();
}
- Proguard :
-dontwarn org.json.**
-keep class org.json** { *; }
- Make sure init is called before start and all the parameter values are proper as the documentation.
- There is no missing dependency as described above.
Check out our demo App implementation
Demo App Apks : PRODUCTION , SANDBOX
documentId |
DID22040413040490937VNTC6LAP8KWD |
String format (Request ID Passed by parent app) |
|---|---|---|
message |
Signing Success |
Failur = Digio sdk crash Webpage could not be loaded = web page not loaded due to internet connection issue even after 3 retries. |
| code | 1001 | DigioConstants. RESPONSE_CODE_SUCCESS = 1001 RESPONSE_CODE_CANCEL = -1000 RESPONSE_CODE_FAIL = 1002 RESPONSE_CODE_WEB_VIEW_CRASH = 1003 RESPONSE_CODE_SDK_CRASH = 1004 |
| screen | document_preview | |
| npciTxnId | String | |
| esignState | {
} |
Object |
documentId |
DID22040413040490937VNTC6LAP8KWD |
String format (Request ID Passed by parent app) |
|---|---|---|
message |
Signing Failur |
String |
| code | -1000 | RESPONSE_CODE_CANCEL = -1000 RESPONSE_CODE_FAIL = 1002 RESPONSE_CODE_WEB_VIEW_CRASH = 1003 RESPONSE_CODE_SDK_CRASH
|
| errorCode | -1000 | RESPONSE_CODE_CANCEL = -1000 RESPONSE_CODE_FAIL = 1002 RESPONSE_CODE_WEB_VIEW_CRASH = 1003 RESPONSE_CODE_SDK_CRASH
WEB_PAGE_NOT_LOADED = -1 TO -16 |
| esignState | {
} |
Object |
Gateway Events :
Refer Gateway document for all posible events and error data : Gateway Event Doc
DigioEvent documentId: string; txnId: string; entity: string; identifier: string; event: string; payload: type: 'error' | 'info'; data?: HashMap<String,Any>; error?: code: string; message: string;
Webview Error Codes and messages. The following webview errors are already handled by digio SDK, The name,description and message will be displayed during sdk journey if any internet connectivity issue happens.
| name | error code description from webview client | error code | messages (manually mapped, error_code may differ) |
|---|---|---|---|
| ERROR_UNKNOWN | Generic error | -1 | net::ERR_FAILED net::ERR_CACHE_MISS |
| ERROR_HOST_LOOKUP | Server or proxy hostname lookup failed | -2 | net::ERR_INTERNET_DISCONNECTED net::ERR_NAME_RESOLUTION_FAILED net::ERR_NAME_NOT_RESOLVED |
| ERROR_UNSUPPORTED_AUTH_SCHEME | Unsupported authentication scheme (not basic or digest) | -3 | net::ERR_ACCESS_DENIED |
| ERROR_AUTHENTICATION | User authentication failed on server | -4 | |
| ERROR_PROXY_AUTHENTICATION | User authentication failed on proxy | -5 | |
| ERROR_CONNECT | Failed to connect to the server | -6 | net::ERR_CONNECTION_FAILED net::ERR_ABORTED net::ERR_CONNECTION_ABORTED net::ERR_CONNECTION_CLOSED |
| ERROR_IO | Failed to read or write to the server | -7 | net::ERR_INVALID_RESPONSE net::ERR_EMPTY_RESPONSE net::ERR_CONTENT_DECODING_FAILED net::ERR_CONTENT_LENGTH_MISMATCH |
| ERROR_TIMEOUT | Connection timed out | -8 | net::ERR_CONNECTION_TIMED_OUT |
| ERROR_REDIRECT_LOOP | Too many redirects | -9 | net::ERR_TOO_MANY_REDIRECTS |
| ERROR_UNSUPPORTED_SCHEME | Unsupported URI scheme | -10 | net::ERR_UNKNOWN_URL_SCHEME |
| ERROR_FAILED_SSL_HANDSHAKE | Failed to perform SSL handshake | -11 | net::ERR_SSL_PROTOCOL_ERROR net::ERR_CERT_DATE_INVALID net::ERR_CERT_AUTHORITY_INVALID net::ERR_BAD_SSL_CLIENT_AUTH_CERT net::ERR_SSL_CLIENT_AUTH_CERT_NEEDED |
| ERROR_BAD_URL | Malformed URL | -12 | net::ERR_INVALID_URL |
| ERROR_FILE | Generic file error | -13 | net::ERR_FILE_TOO_BIG |
| ERROR_FILE_NOT_FOUND | File not found | -14 | net::ERR_FILE_NOT_FOUND |
| ERROR_TOO_MANY_REQUESTS | Too many requests during this load | -15 | |
| ERROR_UNSAFE_RESOURCE | Resource load was canceled by Safe Browsing | -16 | net::ERR_INSUFFICIENT_RESOURCES |
| net::ERR_INVALID_HANDLE | |||
| net::ERR_CONTENT_DECODING_FAILED | |||
| net::ERR_CONTENT_LENGTH_MISMATCH |
-
Version 4.0.14 :
- AGP Update and support for higher version
- Enabled More support for face authentication
-
Version 4.0.8 :
- Added FACE authentication to eSign
- Using protean eSign SDK for biometric and face based authentication
- Removed firebase crashlytics
-
Version 4.0.6 :
- Introduced webview connection error handling with in digio sdk.
- Added internet connection observability, if internet connection get disconnected message will be displayed with in digio sdk.
- Digio activity will run in portrait mode only and will not re-create on any system configuration changes
- Digio Activity will not run in separate process, there is no requirement of any handling in Application class.
- Introduced Gateway events
- 4.0.6 => 4.0.8
- Remove firebase crashlytics dependencies and gradle plugin if not required by app.
- Add following dependencies
implementation 'com.github.digio-tech:protean-esign:v3.2' - Add following to pro-guard rules
-dontwarn org.json.**
-keep class org.json** { *; }
- 4.0.3 => 4.0.6
- implemented onGatewayEvent on DigioResponseListener
- add following dependencies
- add
implementation 'androidx.swiperefreshlayout:swiperefreshlayout:1.1.0'to build.gradle
Note: Digio reserves the right to modify this API document from time-to-time. If you are a business using this API, you will be notified well in advance, prior to any change is made
© Copyright 2016-23 | www.digio.in | For Limited Circulation