documentCapture

public final Response<String> documentCapture(Activity activity, String documentName, Boolean documentCapture, AdditionalCustomerFlagData additionalDataFlag, SDKCustomizationOptions sdkCustomizationOptions)

Document Capture or Upload

Developer Guides :

public class YourActivity extends Activity {
    private var processedCaptures: List? = null

    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
    }

    override fun onActivityResult(requestCode: Int, resultCode: Int, data: Intent?) {
        if (resultCode == RESULT_OK) {
            //for document upload and capture result data
           if (requestCode == CaptureConstants.OPERATION_ADDITIONAL_FEATURES_REQUEST_CODE){
               processedCaptures = data?.extras?.getParcelableArray(IdMissionCaptureLauncher.EXTRA_PROCESSED_CAPTURES)?.toList() as List?
               for (processedCapture: ProcessedCapture in processedCaptures!!) {
                   if(processedCapture is ProcessedCapture.DocumentDetectionResult.RealDocument){
                      var additionalDocData: ProcessedCapture.DocumentDetectionResult.RealDocument = processedCapture

                     //Read base64 data from file
                     val base64file: String = android.util.Base64.encodeToString(additionalDocData?.file?.readBytes(), android.util.Base64.NO_WRAP)
                     Log.d("File_DATA",base64file)
                  }
               }
            }
        }
    }
}

You can access processed captures at the following indexes :

0 - ProcessedCapture instance for Document data.

Parameters

activity

: Requires current activity context.

documentName

: Requires document name.

documentUpload

: boolean to enable Document Upload, otherwise Document Capture will perform. Default value will be false, if null or not passed while invocation.

additionalDataFlag

: Optional parameter to enable Additional Flags.

sdkCustomizationOptions

: Optional parameter to customize camera options. It will take default options, if null or not passed while invocation.