Implement identity verification into your Android app.
Before you start
Before you begin, you must already have a working Android app to which you are adding an
identity-verification engagement scenario.
Unlike other types of engagement scenarios in Android apps that start with the
customer tapping on the Live Experience widget, the identity-verification engagement
starts automatically when the page containing identity verification opens. The user
doesn't tap on anything besides the button or link that opens the page containing the
identity-verification engagement.
Here's what to do
-
Open your tenant application project.
-
Implement the following SDKs in the build.gradle
file:
ext {
JUMIO_SDK_VERSION = "3.6.0"
}
// for Jumio
implementation "com.jumio.android:core:${JUMIO_SDK_VERSION}@aar"
implementation "com.jumio.android:bam:${JUMIO_SDK_VERSION}@aar"
implementation "com.jumio.android:nv:${JUMIO_SDK_VERSION}@aar"
implementation "com.jumio.android:nv-mrz:${JUMIO_SDK_VERSION}@aar"
implementation "com.jumio.android:nv-nfc:${JUMIO_SDK_VERSION}@aar"
implementation "com.jumio.android:nv-ocr:${JUMIO_SDK_VERSION}@aar"
implementation "com.jumio.android:nv-barcode:${JUMIO_SDK_VERSION}@aar"
implementation "com.jumio.android:nv-barcode-vision:${JUMIO_SDK_VERSION}@aar"
implementation "com.jumio.android:face:${JUMIO_SDK_VERSION}@aar"
implementation "com.jumio.android:dv:${JUMIO_SDK_VERSION}@aar"
//for core:
implementation "androidx.appcompat:appcompat:1.0.0"
implementation "androidx.room:room-runtime:2.0.0"
//for nv:
implementation "com.google.android.material:material:1.0.0"
implementation "androidx.cardview:cardview:1.0.0"
//only for nv-nfc
implementation "com.madgag.spongycastle:prov:1.58.0.0"
implementation "net.sf.scuba:scuba-sc-android:0.0.16"
//only for nv-face
implementation "com.facetec:zoom-authentication-hybrid:7.0.4@aar"
-
Add the following activity to
src\main\AndroidManifest.xml:
<activity
android:name="com.jumio.nv.NetverifyActivity"
android:configChanges="orientation|screenSize|screenLayout|keyboardHidden"
android:hardwareAccelerated="true"
android:theme="@style/CustomNetverifyTheme"
android:windowSoftInputMode="adjustResize"/>
-
Add a theme for identity verification to
\src\main\res\values\styles.xml. Use the following sample theme
and modify it as required.
<!-- base application theme for Jumio -->
<style name="CustomNetverifyTheme" parent="Theme.Netverify">
<!-- global colors -->
<item name="colorPrimary">#E0F0FD</item>
<item name="colorPrimaryDark">#cccccc</item>
<item name="colorControlNormal">#000000</item>
<item name="jumio_toolbarStyle">@style/Jumio.Actionbar.Title</item>
<item name="jumio_toolbarSubStyle">@style/Jumio.Infobar.Title</item>
<item name="android:windowBackground">@color/CustomAndroidBackground</item>
<!-- loading sdk specific colors -->
<item name="netverify_scanOptionsLoadingProgress">#FFFFFF</item>
<!-- Replace the HEX color value above to change the loading progress color (SDK start)-->
<!-- select document specific colors -->
<item name="netverify_scanOptionsLoadingBackground">#ffffff</item>
<item name="netverify_scanOptionsItemBackground">#509ed6</item>
<item name="netverify_scanOptionsItemForeground">#ffffff</item>
<item name="netverify_scanOptionsItemHeaderBackground">#4c95c9</item>
<!-- scan instructions specific colors -->
<item name="netverify_helpBackground">#FFFFFFFF</item><!--70%-->
<item name="netverify_helpProgressString">#80000000</item>
<item name="netverify_helpTitle">#000000</item>
<item name="netverify_helpImage">#000000</item>
<item name="netverify_helpSeperator">#33FFFFFF</item>
<item name="netverify_helpInstructions">#000000</item>
<item name="netverify_helpFallback">#FFFFFF</item>
<item name="netverify_helpFallbackText">#222222</item>
<!-- scan document (scan screen) specific colors -->
<item name="netverify_scanOverlay">#B3FFFFFF</item>
<item name="netverify_scanBackground">#40000000</item><!--25%-->
<!-- readability check specific colors -->
<item name="netverify_confirmationBackground">#ffffff</item>
<item name="netverify_confirmationHintStyle">@style/Custom.Netverify.Confirmation.Hint</item>
<item name="netverify_confirmationPositiveStyle">@style/Jumio.Confirm.Button.Positive</item>
<item name="netverify_confirmationNegativeStyle">@style/Jumio.Confirm.Button.Negative</item>
<!-- submission error (error screen) specific colors -->
<item name="netverify_submissionErrorStatusBar">#B3B3B3</item>
<item name="netverify_submissionErrorBackground">#FFFFFF</item>
<item name="netverify_submissionErrorTitle">#1A1A1B</item>
<item name="netverify_submissionErrorDescription">#565B5D</item>
<item name="netverify_submissionErrorSeperator">#000000</item>
<item name="netverify_submissionErrorImage">#FF1911</item>
<item name="netverify_submissionErrorButtonBackground">#3F61B5</item>
<item name="netverify_submissionErrorButtonText">#FFFFFF</item>
<!-- submission success (success screen) specific colors -->
<item name="netverify_submissionProgressSuccessTitle">#000000</item>
<item name="netverify_submissionProgressSuccessDescription">#000000</item>
<item name="netverify_submissionProgressSuccessSeperator">#000000</item>
<item name="netverify_submissionProgressSuccessImage">#509ed6</item>
<item name="netverify_submissionProgressSuccessBackground">#ffffff</item>
</style>
<!-- actionbar title color -->
<style name="Jumio.Actionbar.Title" parent="ThemeOverlay.AppCompat">
<item name="android:textColorPrimary">#000000</item>
</style>
<!-- infobar title color -->
<style name="Jumio.Infobar.Title" parent="@android:style/TextAppearance">
<item name="android:textColor">#000000</item>
</style>
<!-- positive button theme (readability screen) -->
<style name="Jumio.Confirm.Button.Positive" parent="">
<item name="android:textColor">#FFFFFF</item>
<item name="android:background">#509ed6</item>
</style>
<!-- negative button theme (readability screen) -->
<style name="Jumio.Confirm.Button.Negative" parent="">
<item name="android:textColor">#FFFFFF</item>
<item name="android:background">#509ed6</item>
</style>
<!-- readability info theme (readability screen) -->
<style name="Custom.Netverify.Confirmation.Hint" parent="Netverify.Confirmation.Hint">
<item name="android:theme">@style/ThemeOverlay.AppCompat.Dark</item>
<item name="android:background">#ffffff</item>
<item name="android:textColor">#000000</item>
</style>
<color name="CustomAndroidBackground">#ffffff</color>
<style name="WarningDivider">
<item name="android:layout_width">match_parent</item>
<item name="android:layout_height">2dp</item>
<item name="android:background">#E2E2E4</item>
</style>
-
Create a new page for identity verification.
-
In your tenant application, implement some kind of action that opens the new
page. For example, create a button labeled Scan ID that
opens the identity-verification page.
-
In the identity verification page, implement the call logic the same way you
would for any other engagement scenario, but set the
appLocation
value to the engagement scenario that has the
identity verification service enabled. For example, if you are using the default
identity verification engagement scenario to deliver the identity verification
service, set appLocation
to "Know Your
Customer"
:
.
.
.
CommunicationFragment.settings.startVideoInFullScreen = true
CommunicationFragment.settings.startVideoWithFrontCamera = true
CommunicationFragment.contextAttributes.set("appLocation","Know Your Customer")
.
.
.
-
Optionally, enable Jumio`s facial recognition service, which compares and
verifies the likeness of the faces of the person scanning their identity card
and the picture on the card.
The Jumio assessment is reported to the associate in the Live Experience
Associate Desktop. Add the following line of code beneath the context attribute
setting appLocation:
CommunicationFragment.settings.attemptFaceMatchWhenVerifyingIdentity
= true
.
-
Optionally, listen for specific Jumio events and notifications and implement
your own responses. The available Jumio events are:
- Sent when the verification is complete.
LIVE_VERIFICATION_COMPLETE
- Sent when the verification failed.
LIVE_VERIFICATION_FAILED
- Sent when the verification is canceled.
LIVE_VERIFICATION_CANCELED
- Sent when the verification is incomplete.
LIVE_VERIFICATION_INCOMPLETE
- Sent when the session is connecting.
LIVE_CONNECTING
- Sent when the session ended due to error.
LIVE_ERROR
In this example, you are listening for when the scanned documents are successfully
scanned and then flashing a green checkmark to the user.
To capture the event for when the documents have been captured:
// Create Widget and set the customized notification handler
mCxFragment = (CommunicationFragment) manager.findFragmentByTag(FRAGMENT_TAG);
if (mCxFragment == null) {
mCxFragment = CommunicationFragment.newInstance();
getSupportFragmentManager()
.beginTransaction()
.add(R.id.cx_container, mCxFragment, FRAGMENT_TAG)
.commit();
}
mCxFragment.setNotificationHandler(new MceNotificationHandler());
// Implement customized notification handler, and handle the KYC verification result notification
/**
* An implementation for notification handler.
*/
class MceNotificationHandler extends DefaultNotificationHandler {
private EventType lastEvent = EventType.LIVE_ENDED;
@Override
public void notification(final NotificationPayload payload) {
super.notification(payload);
synchronized (lastEvent) {
lastEvent = payload.getEventType();
if (lastEvent == EventType.LIVE_VERIFICATION_COMPLETE
|| lastEvent == EventType.LIVE_VERIFICATION_FAILED
|| lastEvent == EventType.LIVE_VERIFICATION_CANCELED
|| lastEvent == EventType.LIVE_VERIFICATION_INCOMPLETE) {
handleKycNotification(lastEvent);
}
}
}
}
The following example listens for
LIVE_VERIFICATION_COMPLETE
and
then obtains the associated Jumio reference code (which you can use in REST API
calls to the Jumio API):
// Get the Jumio reference code getKycReference()
private void handleKycNotification(EventType eventType) {
Log.d(TAG, "handleKycNotification: " + eventType.name());
if (eventType == EventType.LIVE_VERIFICATION_COMPLETE) {
Log.d(TAG, "kycScanReference: " + CommunicationFragment.service.getKycScanReference());
}
...
For the complete list of Live Experience notification events, see the Oracle Live Experience Android API
Reference.