Flutter SDK ">=2.12.0 <3.0.0"
iOS 11 and above
Xcode "16.0"
Add to pubspec.yaml
file under dependencies
group:
trust_vision_plugin:
git:
# Replace the below with your specific info
url: to_be_replaced
ref: to_be_replaced
$ flutter pub get
# Add below lines to the end of podfile
post_install do |installer|
installer.pods_project.targets.each do |target|
// you can add more modules which have the error "Undefined symbol" into the list
if ['CocoaLumberjack', 'TensorFlowLiteC', 'TensorFlowLiteSwift', 'PromiseKit', 'lottie-ios', 'OpenSSL-Universal','CryptoSwift'].include? "#{target}"
target.build_configurations.each do |config|
config.build_settings['BUILD_LIBRARY_FOR_DISTRIBUTION'] = 'YES'
config.build_settings["EXCLUDED_ARCHS[sdk=iphonesimulator*]"] = "arm64"
end
end
end
end
Set Build Libraries for Distribution in Build Settings to No
$ pod install
Add to root-level build.gradle file (host app):
def localProperties = new Properties()
def localPropertiesFile = rootProject.file('local.properties')
if (localPropertiesFile.exists()) {
localPropertiesFile.withReader('UTF-8') { reader ->
localProperties.load(reader)
}
}
def flutterRoot = localProperties.getProperty('flutter.sdk')
if (flutterRoot == null) {
throw new GradleException("Flutter SDK not found. Define location with flutter.sdk in the local.properties file.")
}
allprojects {
repositories {
google()
mavenCentral()
/*
Replace the below with your path to `trust_vision_plugin` Android repo which downloaded by `flutter pub get`.
*/
maven { url "$flutterRoot/.pub-cache/git/replace_by_git_repo_name-replace_by_commit_hash/android/repo" }
/*
For example:
maven { url "$flutterRoot/.pub-cache/git/tv_flutter_sdk_xyz-1a5eb61ccb44ffafa4d3557f4d9d8087bc1a4666/android/repo" }
*/
}
}
Add to app/build.gradle:
aaptOptions {
noCompress "tflite"
noCompress "lite"
}
import 'package:trust_vision_plugin/trust_vision_plugin.dart';
The SDK provides some built in Activities example activity to eKYC journey.
Map<String, dynamic> config = {
"token": "your_token",
"baseUrl": "your_url",
"language" : "en" ,
"flowId: "your_value"
"enableSound: true,
"cardTypes": "your_value",
"singleStep" : "your_value"
};
Where:
String
This is the authentication token required to call the eKYC platform API within the SDK. Obtain this token from TrustingSocial eKYC Platform.String
The base URL for the eKYC platform API. This is also provided by TrustingSocial eKYC Platform.String?
, that specifies the language for SDK display. Set this to your preferred language code (e.g., "en" for English, "vi" for Vietnamese)bool
that enables or disables guiding sound during the eKYC process. Set to true
to enable sound or false
to disable itString?
, that identifies the specific eKYC flow you want to execute. Choose from the following options:- ID → Selfie: flowId=id_selfie
- Selfie → ID: flowId=selfie_id
- ID → NFC → Selfie: flowId=id_nfc_selfie
- QR → NFC → Selfie: flowId=qr_nfc_selfie
cardType: TVCardType?
object that specifies the type of card being used in the eKYC process. The card type is defined as follows:
singleStep : String?
, Optional Single Step mode:
Value | Description |
---|---|
"ekyc.id_card" | Only ID Card capture |
"ekyc.selfie" | Only Selfie capture |
TVCardType cardType = TVCardType(
id: "vn.national_id",
name: "CMND cũ / CMND mới / CCCD / Hộ chiếu",
hasBackSide: true,
orientation: TVCardOrientation.HORIZONTAL,
);
void startEKYCPlatformNative() async {
try {
Map<String, dynamic> config = {
"token": token,
"baseUrl": url,
"language" : "en",
};
String? result = await TrustVisionPlugin.instance
.starteYKCPlatform(configurations: config);
if (result != null) {
// Handle successfull
}
} catch (e) {
// Handle error
}
}
final url = "your_url"
try {
String? result =
await TrustVisionPlugin.instance.starteYKCPlatformWebview(url: url);
if (result != null) {
// Handle successfull
}
} catch (e) {
// Handle error
}