Physical ID Card Capture

The physical ID Capture introduces a way to capture photos of physical ID documents

Steps to implementation

Step 1

In your layout file add the SmartCardView. We advise on giving the view as much real estate as possible so match parent on both height and width is advisable

<com.smileidentity.libsmileid.core.idcapture.SmartCardView
        android:id="@+id/id_capture"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        <!--optional fields for customisation-->
        xmlns:app="http://schemas.android.com/apk/res-auto"
        app:faceDetectedMessage="Custom face detected message"
        app:blurryMessage="Custom message for when capture is blurry"
        app:insufficientLightMessage="Custom message for when there is insufficient light"
        app:fitIdMessage="Custom message informing the user to fit the id on the rectangle and tap for focus"
        app:flashMissingErrorMessage="Custom flash missing error message"
        app:loadingMessage="Custom message for when ID capture is loading"
        app:detectingFaceMessage="Custom message for when ID capture face detection is in progress"
        app:noFaceDetectedMessage="Custom no face detected message"
        app:capturedBlurryMessage="Custom blurriness detected in captured image"
        app:capturedDarkMessage="Custom darkness detected in captured image"
        >
 </com.smileidentity.libsmileid.core.idcapture.SmartCardView>

Step 2

Initialize the view in your view controller as normal and set the listener so that the SDK can pass back information on the capture

Step 3

Set your desired id type, this is an instance of IDType enum with options

  • Idcard => Aspect ratio 1.4 or normal credit card sized IDs

  • Passport => Aspect ratio 1.6 or normal passbort booklet sized IDs

  • Other => will default to 1.4 aspect ratio

Step 4

Start Capture, typically this should be called in your onResume so that the view maintains state with the implementing Activity/Fragment

The start capture method will display the view which should look like below

The method has a couple of possible errors that should be catered for this is important to make sure users get the best user experience and for handling possible failures gracefully.

Step 5

Implement pausing on the capture to handle view lifecycles

Step 6

Error handling and callbacks from the ID Capture

ID Capture Custom Messaging

To enable customization and internationalization from version 7.1.0 the ID Capture allows messaging customization through out the whole capture process as demonstrated in step 1

Last updated

Was this helpful?