TrustVision SDK is an android SDK for TrustVision Engine. It provides these features:
Add key to info.plist:
<key>NSCameraUsageDescription</key>
<string>Open camera</string>
The SDK provides some built in Activities example activity to capture id, selfie, liveness...
The id capturing activity will show the camera to capture image, preview the image. To start the id capturing activity.
let config: TVIdCardConfiguration = TVIdCardConfig()
config.idCardSide = TVCardSide.front
config.cardType = selectedCardType
confg.isEnableSound = false
Options:
TVCardType
. List of supported cards can be found by let cardTypes: [TSCardType] = try TrustVisionSdk.getCardTypes()
TVCardSide
. Card side to captureBool
. Sound should be played or notBool
. Check id card sanity or notBool
. If true then the sdk will capture both side if possible; otherwise, then the card side defined in cardSide will be usedBool
. Check id card tampering or notlet vc = TrustVisionSdk.startIdCapturing(configuration: config, success: { (result) in
}, failure: { (error) in
}, cancellation: {
// sdk is canceled
})
where:
TVIdCardConfiguration
TVDetectionResult
. Use the following fields:FailureCallback
CancellationCallback
The selfie capturing activity will show the camera to capture image, preview the image and verify active liveness in local. To start the selfie capturing activity.
let config: TVSelfieConfiguration = TVSelfieConfiguration()
config.cameraOption = TVCameraOption.front
confg.isEnableSound = false
config.livenessMode = TVLivenessMode.passive
Options:
TVCameraOption
.TVLivenessMode
let vc = TrustVisionSdk.startSelfieCapturing(configuration: config, success: { (result) in
}, failure: { (error) in
}, cancellation: {
// sdk is canceled
})
where:
TVSelfieConfiguration
TVDetectionResult
. Use the following fields:FailureCallback
CancellationCallback
Method | Type | description |
---|---|---|
frontIdImage | TVEncryptedImage | Image of id card's front side (use field rawImage ) |
backIdImage | TVEncryptedImage | Image of id card's back side (use field rawImage ) |
selfieImages | [TVGestureImage] | Images of selfie |
isLive | Bool | Selfie images are live or not |
Will be called in case failed. Parameters:
TVError
.Will be called in case the sdk is cancelled. No parameters