Last updated:
0 purchases
hypersnapsdk flutter
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
copied to clipboard
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:
Ensure that the minimum SDK version is 19 or higher
Enable multidex
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"
}
}
}
copied to clipboard
Sync the project
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;
}
copied to clipboard
iOS #
To setup an iOS project:
Run pod install
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';
copied to clipboard
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,
);
}
copied to clipboard
Starting Document Capture #
To start the document capture screen, invoke the start() static method from the HVDocsCapture class
HVDocsCapture.start()
copied to clipboard
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:
Set optional configurations for the feature.
Start the document capture flow in your application.
Handle the document capture results.
Note:
The below sample code does not include all optional configurations. See Configuring HyperSnapSDK for the complete list.
copied to clipboard
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
}
},
);
}
copied to clipboard
Starting Face Capture #
To start the face capture screen invoke the start() static method from the HVFaceCapture class.
HVFaceCapture.start()
copied to clipboard
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:
Set optional configurations for the feature.
Start the face capture flow in your application.
Handle the face capture results.
Note:
The below sample code does not include all optional configurations. See Configuring HyperSnapSDK for the complete list.
copied to clipboard
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
}
},
);
}
copied to clipboard
Starting Barcode Capture #
To start the Barcode Capture screen invoke the start() method from the HVBarcodeScanCapture class.
HVBarcodeScanCapture.start()
copied to clipboard
The following is a sample integration code. You can use it to:
Set optional configuration for the feature.
Start the Barcode capture flow in your application.
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');
}
},
);
}
copied to clipboard
Please contact Hyperverge for complete documentation details #
For personal and professional use. You cannot resell or redistribute these repositories in their original state.
There are no reviews.