hypersnapsdk_flutter 4.21.0 copy "hypersnapsdk_flutter: ^4.21.0" to clipboard
hypersnapsdk_flutter: ^4.21.0 copied to clipboard

HyperSnapSDK is HyperVerge's documents + face capture SDK that captures images at a resolution appropriate for our OCR and Face Recognition AI Engines.

Overview #

HyperSnapSDK is a software development kit by HyperVerge that offers an out-of-the-box ability to scan QR codes, documents or faces, while simplifying API integrations across all HyperVerge products. It also enables you to customise the integration to match your application's unique requirements.

It streamlines capturing of images at a resolution best suited for HyperVerge's deep learning OCR and face recognition engines. The framework also provides a liveness feature that uses advanced AI engines to verify if an image used in the identity verification flow has a live human subject or is a fraudulent attempt at passing a photograph of the subject as a live sample.

Installing HyperSnapSDK Flutter Plugin #

The HyperSnapSDK Flutter plugin is available on Pub - hypersnapsdk_flutter

Run the following command in your flutter project directory to add all the dependencies of the latest HyperSnapSDK Flutter plugin in your pubspec.yaml file. It runs an implicit dart pub get

$ flutter pub add hypersnapsdk_flutter

Migrating to Flutter v4.10.0 #

Please refer this migration doc to migrate to the latest version (v4.10.0)

Android #

To setup an Android project:

  1. Ensure that the minimum SDK version is 19 or higher
  2. Enable multidex
  3. Open android orbuild.gradle`` file and add the following lines inside the allprojects function
allprojects {  
	repositories {  
		...
		maven {
            url "https://s3.ap-south-1.amazonaws.com/hvsdk/android/releases"
        }
	 }
 }
  1. Sync the project
  2. Add the following proguard lines in your proguard file for release builds
-dontwarn co.hyperverge.** 
-keepclassmembers class * implements javax.net.ssl.SSLSocketFactory { 
	private javax.net.ssl.SSLSocketFactory delegate; 
}

iOS #

To setup an iOS project:

  1. Run pod install
  2. In the info.plist file, add Privacy - Camera Usage Description

Getting Started with HyperSnapSDK #

Using the HyperSnapSDK Flutter Plugin in dart files #

Import the HyperSnapSDK Flutter plugin using the following code:

import 'package:hypersnapsdk_flutter/hypersnapsdk_flutter.dart';

Initialising HyperSnapSDK #

Initialise HyperSnapSDK in your flutter application using the HyperSnapSDK class.

You can use additional SDK configuration options to suit your application's requirements, made available through a set of static methods (or class methods) under the HyperSnapSDK class. This includes configuration options such as managing user sessions, implementing security measures, changing the UI and setting timeout values.

The following is a sample code to initialise HyperSnapSDK using an initHyperSnapSDK wrapper function.

void initHyperSnapSDK() async {
    // Add appId and appKey
  	HyperSnapSDK.initialize(
      '<appId>', 
      '<appKey>',
      Region.india,
    );
  }

Starting Document Capture #

To start the document capture screen, invoke the start() static method from the HVDocsCapture class

HVDocsCapture.start()

The document capture feature supports optional configuration options. You can use the relevant class attributes under the Document Capture configuration classes to implement features including select document type, display review screen and enable the auto-capture functionality.

The following is a sample integration code. You can use it to:

  1. Set optional configurations for the feature.
  2. Start the document capture flow in your application.
  3. Handle the document capture results.
Note: 
The below sample code does not include all optional configurations. See Configuring HyperSnapSDK for the complete list.
startDocCapture() async {
    //	1. Set optional configs
    var hvDocConfig = HVDocConfig(
      shouldShowInstructionPage: true,	//	To Display Instructions Screen
			hvOCRAPIDetails: HVOCRAPIDetails(
        ocrEndpoint: "<your-ocr-endpoint>",
        documentSide: DocumentSide.front,
        params: {<your-ocr-params>},
        headers: {<your-ocr-headers>},
      ),	//	To make OCR API Call once document is captured
      hvDocCaptureUIStrings: HVDocCaptureUIStrings(
        docInstructionsTitle: "custom doc instruction title",
        docCaptureTitle: "custom doc capture title",
        //	Find all available customisations in "Configuring HyperSnapSDK" page
      ),	//	To customise texts in the document capture flow
    );

	//	2. Start Document Capture Flow
    await HVDocsCapture.start(
      //	Pass required HVDocConfig -> Can be default config - HVDocConfig()
      hvDocConfig: hvDocConfig,
      //	3. Handle Document Capture Result
      onComplete: (hvResponse, hvError) {
        if (hvError != null) {
          //	Handle Error scenario
          //	For more details on HVError, take a look at "Response and Error" page
          log("error code: ${hvError.errorCode}");
          log("error message: ${hvError.errorMessage}");
        }
        if (hvResponse != null) {
          //	Handle Success scenario
          if (hvResponse.imageUri != null) 
            log("image uri: ${hvResponse.imageUri!}");
          if (hvResponse.apiResult != null) 
            log("api result: ${hvResponse.apiResult!.toString()}");
            //	For more details on HVResponse, take a look at "Response and Error" page
        }
      },
    );
  }

Starting Face Capture #

To start the face capture screen invoke the start() static method from the HVFaceCapture class.

HVFaceCapture.start()

The face capture feature supports optional configuration options. You can use the relevant class attributes under the Face Capture Configuration Classes And Enums to implement features including display instructions page, enable the back camera and auto-capture functionality.

The following is a sample integration code. You can use it to:

  1. Set optional configurations for the feature.
  2. Start the face capture flow in your application.
  3. Handle the face capture results.
Note: 
The below sample code does not include all optional configurations. See Configuring HyperSnapSDK for the complete list.
startFaceCapture() async {
	//	1. Set Optional configs
    HVFaceConfig hvFaceConfig = HVFaceConfig(
      shouldShowInstructionPage: true, //	To Display Instructions Screen
      hvFaceCaptureUIStrings: HVFaceCaptureUIStrings(
        faceInstructionsTitle: "custom face instruction title",
        faceCaptureTitle: "custom face capture title",
        //	Find all available customisations in "Configuring HyperSnapSDK" page
      ), //	To customise texts in the face capture flow
    );

    //	2. Start Face Capture Flow
    await HVFaceCapture.start(
      //	Pass required HVFaceConfig -> Can be default config - HVFaceConfig()
      hvFaceConfig: hvFaceConfig,
      //	3. Handle Face Capture Result
      onComplete: (hvResponse, hvError) {
        if (hvError != null) {
          //	Handle Error scenario
          //	For more details on HVError, take a look at "Response and Error" page
          log("error code: ${hvError.errorCode}");
          log("error message: ${hvError.errorMessage}");
        }
        if (hvResponse != null) {
          //	Handle Success scenario
          if (hvResponse.imageUri != null)
            log("image uri: ${hvResponse.imageUri!}");
          if (hvResponse.apiResult != null)
            log("api result: ${hvResponse.apiResult!.toString()}");
            //	For more details on HVResponse, take a look at "Response and Error" page
        }
      },
    );
  }

Starting Barcode Capture #

To start the Barcode Capture screen invoke the start() method from the HVBarcodeScanCapture class.

HVBarcodeScanCapture.start()

The following is a sample integration code. You can use it to:

  1. Set optional configuration for the feature.
  2. Start the Barcode capture flow in your application.
  3. Handle the Barcode capture results.
barcodeScanCapture() async {
	//	1. Set Optional configs
    var hvBarcodeConfig = HVBarcodeConfig(
        shouldShowInstructionPage: true, //	To Display Instructions Screen
        hvBarcodeScanUIStrings: HVBarcodeScanUIStrings(
          barcodeInstructionsTitle: "custom barcode instruction title",
          barcodeCaptureTitle: "custom barcode capture title",
          //	Find all available customisations in "Configuring HyperSnapSDK" page
        ),	//	To customise texts in the face capture flow
    );

    //	2. Start Barcode Capture Flow
    await HVBarcodeScanCapture.start(
      //	Pass required HVBarcodeConfig -> Can be default config - HVBarcodeConfig()
      hvBarcodeConfig: hvBarcodeConfig,
      //	3. Handle Barcode Capture Result
      onComplete: (hvResult, hvError) {
        if (hvError != null) {
          //	Handle Error scenario
          //	For more details on HVError, take a look at "Response and Error" page
          log("error code : ${hvError.errorCode}");
          log("error message : ${hvError.errorMessage}");
        }
        if (hvResult != null) {
          //	Handle Success scenario
          log('barcode result: $hvResult');
        }
      },
    );
  }

Please contact Hyperverge for complete documentation details #

11
likes
120
pub points
89%
popularity

Publisher

unverified uploader

HyperSnapSDK is HyperVerge's documents + face capture SDK that captures images at a resolution appropriate for our OCR and Face Recognition AI Engines.

Homepage

Documentation

API reference

License

unknown (LICENSE)

Dependencies

flutter

More

Packages that depend on hypersnapsdk_flutter