Flutter Plugin (Enhanced Version)
This documentation is for the Enhanced Version, encompassing expanded capabilities and advancements. We strongly recommend testing this version before using it in a production environment.
Getting Started
Latest release:
Requirements
- iOS 13.0 and higher Or API level 23 (Android 6.0) or higher
- Internet connection
- Camera
Resources
Integration Sample (Dart): Shufti Pro Flutter-SDK
Integration
SDK Integration Guide
It’s always recommended to use the updated version
Step 1: Run this command: dart pub add shuftipro_onsite_sdk
with dart or flutter pub add shuftipro_onsite_sdk
with flutter
Or
Add dependency in pubspec.yaml
as
dependencies:
shuftipro_onsite_sdk: ^1.0.0
Step 2: Go to project
> android
> build.gradle
file and add the following
allprojects {
repositories {
google()
mavenCentral()
maven { url 'https://jitpack.io' } // add this line
}
}
Step 3: Go to project
> android
> app
> build.gradle
file and add the following
android {
//Rest of your code
dataBinding {
enabled = true
}
}
Step 4: For IOS, make sure to add the following post-install hook to your Podfile.
post_install do |installer|
installer.aggregate_targets.each do |target|
target.xcconfigs.each do |variant, xcconfig|
xcconfig_path = target.client_root + target.xcconfig_relative_path(variant)
IO.write(xcconfig_path, IO.read(xcconfig_path).gsub("DT_TOOLCHAIN_DIR", "TOOLCHAIN_DIR"))
end
end
installer.pods_project.targets.each do |target|
target.build_configurations.each do |config|
if config.base_configuration_reference.is_a? Xcodeproj::Project::Object::PBXFileReference
xcconfig_path = config.base_configuration_reference.real_path
IO.write(xcconfig_path, IO.read(xcconfig_path).gsub("DT_TOOLCHAIN_DIR", "TOOLCHAIN_DIR"))
end
if ['Socket.IO-Client-Swift', 'Starscream'].include? target.name
config.build_settings['BUILD_LIBRARY_FOR_DISTRIBUTION'] = 'YES'
config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'] = '12.0'
end
end
end
end
Step 5: import 'package:shuftipro_onsite_sdk/shuftipro_onsite_sdk.dart' in your class to send the request to ShuftiPro's SDK.
See the sample project provided to learn the most common use. Make sure to build on real devices.
Basic Usage
Make sure you have obtained authorization credentials before proceeding. You can get client id or secret key and generate access token like this.
Authorization
The following code snippet shows how to use the access token in auth object.
Access Token
Make auth object using access token
Map<String,Object> authObject = {
"auth_type": "access_token",
"access_token": accessToken,
};
Configuration
The Shufti Pro’s mobile SDKs can be configured on the basis of parameters provided in the config object. The details of parameters can be found here.
Map<String,Object> configObject = {
"base_url": "api.shuftipro.com",
"show_requirement_page": true ,
"consent_age": 16,
};
Request Object
This object contains the service objects and their settings through which the merchant wants to verify end users. Complete details of service objects and their parameters can be found here.
Map<String, Object> createdPayload = {
"country": "US",
"reference": "12345678",
"language": "EN",
"email": "",
"verification_mode": "image_only",
"show_results": 1,
"face": {},
"document": {
"supported_types": [
"passport",
"id_card",
"driving_license",
"credit_or_debit_card",
],
/* Keep name, dob, document_number, expiry_date, issue_date empty for with-OCR request*/
"name": {
"first_name": "John",
"last_name": "Johsan",
"middle_name": "Livone",
},
"dob": "",
"document_number": "19901112",
"expiry_date": "1996-11-12",
"issue_date": "1990-11-12",
"gender": "M",
"backside_proof_required": "1",
},
//Creating Document Two Object is exactly the same as document object.
"address": {
"full_address": "ST#2, 937-B, los angeles.",
"name": {
"first_name": "Johon",
"last_name": "Johsan",
"middle_name": "Livone",
},
"supported_types": ["id_card", "utility_bill", "bank_statement", "passport", "driving_license"],
},
/* Keep name and full_address empty for with-OCR request */
"consent": {
"supported_types": ["printed", "handwritten"],
"text": "My name is John Doe and I authorise this transaction of \$100/-",
},
};
Initialisation
Shufti Pro's mobile SDK can be initialized by using the following method and passing auth, config and request objects as the parameters.
ShuftiproSdk.sendRequest(authObject, createdPayload, configObject);
Callbacks
The SDK receives callback events as result, whether the verification journey is completed or left mid-way. The call back is received in following function
var response = await ShuftiproSdk.sendRequest(authObject, createdPayload, configObject);
The complete list of callback events can be found here.
Customisation
ShuftiPro supports a set of customization options that will influence the appearance of the mobile SDK.
Verification flow and UI
The complete verification journey is customisable. To skip the screen from verification flow, you need to provide corresponding parameter to the SDK through the request/config object. For instance;
Request Object
"country" : "GB"
"verification_mode" : "image_only"
"allow_online" : "1"
"allow_offline" : "1"
"decline_on_single_step" : "1"
"show_feedback_form" : "1"
"show_ocr_form" : "1"
Config Object
"show_requirement_page": true
"base_url": "api.shuftipro.com"
"consent_age": 16
Localization
Shufti Pro offers users the capability to customize the SDK text according to their preferred language. Merchants can modify the SDK language by specifying the language code in the country parameter within the main request object, such as "language": "en"
Revision History
Date | SDK Versions | Description |
---|---|---|
Dec 12, 2023 | 1.0.0 | Onsite SDK now offers an enhanced user interface along with improved features for localization, OCR Form, and a Retry Option. |