Add to package.json
file under dependencies
group:
"react-native-trust-vision-SDK": "git+https://<github_token>:[email protected]/tsocial/<repo_name>#<version_tag_name>"
$ yarn
...
pod 'RNTrustVisionRnsdkFramework', path: '../node_modules/react-native-trust-vision-SDK'
...
# Add below lines to the end of podfile
post_install do |installer|
installer.pods_project.targets.each do |target|
target.build_configurations.each do |config|
config.build_settings['OTHER_SWIFT_FLAGS'] = '$(inherited) -no-verify-emitted-module-interface'
end
// you can add more modules which have the error "Undefined symbol" into the list
if ['CocoaLumberjack', 'TensorFlowLiteC', 'TensorFlowLiteSwift', 'PromiseKit', 'OpenSSL-Universal', 'CryptoSwift'].include? "#{target}"
target.build_configurations.each do |config|
config.build_settings['BUILD_LIBRARY_FOR_DISTRIBUTION'] = 'YES'
end
end
end
end
$ pod install
Add to root-level build.gradle
file (host app):
maven {
url("$rootDir/../node_modules/react-native-trust-vision-SDK/android/repo")
}
eg:
allprojects {
repositories {
mavenLocal()
...
maven {
url("$rootDir/../node_modules/react-native-trust-vision-SDK/android/repo")
}
google()
jcenter()
maven { url 'https://jitpack.io' }
}
}
Add to app/build.gradle
android {
...
aaptOptions {
noCompress "tflite"
noCompress "lite"
}
}
import { NativeEventEmitter } from "react-native";
import RNTrustVisionRnsdkFramework, {
TVConst,
TVErrorCode,
TVThemeCustomization,
} from "react-native-trust-vision-SDK";
The SDK provides some built in Activities example activity to eKYC journey.
const config = {
baseUrl: "your_value",
token: "your_value",
enableSound: true,
language: "en",
flowId: "your_value",
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
String?
, Optional Single Step mode:Value | Description |
---|---|
"ekyc.id_card" | Only ID Card capture |
"ekyc.selfie" | Only Selfie capture |
TVCardType?
object that specifies the type of card being used in the eKYC process. The card type is defined as follows:const cardType = {
id: "vn.national_id",
name: "CMND cũ / CMND mới / CCCD",
orientation: TVConst.Orientation.HORIZONTAL,
hasBackSide: true,
frontQr: {
exist: true,
type: "qr_code",
widthHeightRatio: 1,
},
};
const startEKYCPlatformNative = async () => {
try {
const cardType = {
id: "vn.national_id",
name: "CMND cũ / CMND mới / CCCD",
orientation: TVConst.Orientation.HORIZONTAL,
hasBackSide: true,
frontQr: {
exist: true,
type: "qr_code",
widthHeightRatio: 1,
},
};
const config = {
baseUrl: inputEndpoint,
token: inputToken,
enableSound: false,
language: "vi",
flowId: "",
cardTypes: [cardType],
};
const result = await RNTrustVisionRnsdkFramework.startEKYCPlatform(config);
// Handle successfull
} catch (e) {
// Handle error
}
};
const startEKYCPlatformWebview = async () => {
try {
const result = await RNTrustVisionRnsdkFramework.startEKYCPlatformWebview(
"your_url"
);
// Handle successfull
} catch (e) {
// Handle error
}
};