Smile Identity UI
Please note this requires version 7.2.0 of the SDK
Smile Identity UI is a layer that provides abstraction from the mundane things of building the screens required for selfie capture and ID card capture.

Installation

Step 1: Add the Smile ID UI as a dependency

If this is your first time integrating with Smile Identity Android SDK follow every step as per the Getting Started guides except on Gradle integration step 3 you replace the corer library with the below
1
implementation 'com.smileidentity:smile-id-ui:0.0.1'
Copied!
NB: If you have already integrated with the Android SDK only Remove the reference to the Smile Identity dependency as the Smile UI will automatically pull the correct version in.

Step 2: Required Permissions

Before calling the Smile UI screens make sure the below permissions are allowed by the user
1
Manifest.permission.CAMERA,
2
Manifest.permission.ACCESS_FINE_LOCATION,
3
Manifest.permission.READ_PHONE_STATE}
Copied!
Step 3: Add Smile UI Activities to your application manifest
1
<!--id capture-->
2
<activity android:name="com.smileid.smileidui.SIDIDCaptureActivity" />
3
<!--selfie capture-->
4
<activity android:name="com.smileid.smileidui.SIDSelfieCaptureActivity" />
5
<!--selfie review screen-->
6
<activity android:name="com.smileid.smileidui.SIDReviewActivity" />
Copied!

Step 3: Call Smile UI

Call the required screen or screens as per the example below
1
new SIDCaptureManager.Builder(this, CaptureType.SELFIE, SMILE_SELFIE_REQUEST_CODE).build().start();
Copied!
The above will call a screen as per the CaptureType specified and you have 4 options to choose from
CaptureType.SELFIE Will show the selfie screen then the review screen before sending the results back to your application
CaptureType.IDCAPTURE Will show the ID card capture screen then send results back to your application
CaptureType.SELFIE_AND_ID_CAPTURE Will show the selfie screen then the review screen and then the id card capture screen before sending the results back to your application CaptureType.ID_CAPTURE_AND_SELFIE Will show the id card capture screen then the selfie screen then the review screen and before sending the results back to your application.

Step 4: Implement Callback using onActivityResults

The onAcivityResults method will return an intent with the following data
1
@Override
2
protected void onActivityResult(int requestCode, int resultCode, @Nullable final Intent data) {
3
super.onActivityResult(requestCode, resultCode, data);
4
/*
5
* -1 for success
6
* 1011 for permissions required permissions error
7
* 999 for any error that occurrs from the selfie capture
8
* 888 for id capture failure after starting selfie
9
* 777 when id capture was manually cancelled by the user
10
*
11
com.smileid.smileidui.SELFIE_REQUEST_RESULT
12
13
//the Tag that was used to ccapture the selfie or the id card
14
com.smileid.smileidui.SMILE_REQUEST_RESULT_TAG
15
16
//indicating wheather a face was found or not on the ID Capture
17
com.smileid.smileidui.ID_REQUEST_FACE_FOUND_RESULT
18
}
Copied!
Last modified 4mo ago
Copy link
Contents
Installation