TrustVision SDK is an iOS SDK for TrustVision Engine. It provides these features:
Adding *. framework and *.bundle by "Add Files to {your_name_project}"
Note: Set up the optional status for TrustVisionNFC.xcframework
<key>NSCameraUsageDescription</key>
<string>Open camera</string>
pod 'TensorFlowLiteSwift', '~> 2.11.0'
pod 'PromiseKit', '~> 6.8'
pod 'CocoaLumberjack/Swift'
pod 'OpenSSL-Universal', '1.1.180' # if you are using module NFC
pod 'CryptoSwift', '~> 1.4.0'
post_install do |installer|
installer.pods_project.targets.each do |target|
// If when compiling your project, "Undefined symbol" occurs, please add the module name which is having the error here
// add OpenSSL-Universal if you are using module NFC
if ['CocoaLumberjack', 'TensorFlowLiteC', 'TensorFlowLiteSwift', 'PromiseKit', '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
If not, add manually:
Embed & Sign
CocoaLumberjack.framework
PromiseKit.framework
Do Not Embed
TensorFlowLite.framework
TensorFlowLiteC.framework
Validate Workspace
in Build Settings
If host app is using Objective-C, please follow these additional steps:
SWIFT_VERSION
)-lc++
and -ObjC
in Other linker flags
The SDK provides some built in Activities example activity to eKYC journey.
let config = TVPlatformConfigurationBuilder()
.setUserIdentityToken(yourUserIdentityToken)
.setBaseUrl(yourBaseUrl)
.setEnableSound(true)
.setCardTypes([TVCardType.defaultVnCardType()])
.setFlowId(yourFlowId)
.setSingleStep(yourSingleStep)
.build()
Configuration Options:
Name | Type | Required | Description |
---|---|---|---|
userIdentityToken | String | yes | Identify user to the eKYC platform. |
baseUrl | String | yes | The eKYC platform base URL |
enableSound | Bool | no | Enable SDK sound, default: false |
cardTypes | [TVCardType] | no | Allowed card types |
flowId | String | no | Optional flow control |
singleStep | String | no | Optional Single Step mode |
You can configure SDK to run a specific step directly by setting singleStep
.
Supported values for singleStep
:
Value | Description |
---|---|
"ekyc.id_card" | Only ID Card capture |
"ekyc.selfie" | Only Selfie capture |
Example usage:
let config = TVPlatformConfigurationBuilder()
.setUserIdentityToken(yourUserIdentityToken)
.setBaseUrl(yourBaseUrl)
.setSingleStep("ekyc.selfie")
.setFlowId("id_selfie")
.build()
If
setSingleStep()
is not used, SDK defaults to full eKYC flow based onflowId
.
Available flowId values:
flowId | Description |
---|---|
id_selfie | ID -> Selfie |
selfie_id | Selfie -> ID |
id_nfc_selfie | ID -> NFC -> Selfie |
qr_nfc_selfie | QR -> NFC -> Selfie |
let vc = TrustVisionSdk.shared.startEkycPlatform(withConfig: config, completion: { (result) in
}, failure: { (error) in
}, cancellation: {
// sdk is canceled
})
where:
TVPlatformConfiguration
(TVPlatformResult) -> Void
method that will be called in case success. Parameters:TVPlatformResult.ResultType
. The result enum of the eKYC platform..success
: Success.failure
: Failure/Rejectionbool
. SDK internal flag for fully completed stateFailureCallback
() -> Void
let vc = TrustVisionSdk.shared.startEkycPlatformWebview(withUrl: yourUrl, completion: { (result) in
}, failure: { (error) in
}, cancellation: {
// sdk is canceled
})
where:
String
. The URL of the eKYC platform webview.Int
. The status of the eKYC platform webview.(String) -> Void
() -> Void