2 User Guide
Last updated
Last updated
Before using the SDK, the SDK first needs to be integrated into the development environment. The development environment of the project requires to be Xcode 7.0 or later, and the operating environment requires iOS7.0 or later.
The detailed operational requirement is described below.
Import the SDK package.
Drag the libSTSilentLivenessController folder into the project, note that the copy option is checked, and click Finish button.
This SDK does not support CocoaPods.
Import the license file.
For details, please refer to License introduction.
Xcode linker parameters must be added: -ObjC and -lc++.
After adding the -ObjC parameter, the linker can load all Objective-C classes and categories in the static library into the final executable file.
The -lc++ parameter is added because the static library requires c++ standard library support.
How to add:
Add -lc++ and -ObjC to TARGETS > Build Settings > Linking > Other Linker Flags.
If the development tool used is Xcode 7.0 or a later version, Bitcode needs to be closed manually.
Steps:
Set to NO to TARGETS > BuildSettings > Enable Bitcode.
When debugging systems on iOS 10 or later using Xcode 8 or later, camera access permission needs to be added in the info.plist file when calling the camera function.
The interface call of the silent liveness detection SDK is mainly for the STSilentLivenessController. The following is a detailed introduction.
1. Comply with STSilentLivenessDetectorDelegate protocol and STSilentLivenessControllerDelegate protocol.
2. Initialize the view controller for silent liveness detection.
3. Set optional conditions for silent liveness detection
Set the liveness detection timeout time, pass conditions, hack threshold, occlusion, illumination conditions, blurriness, and eye open filtering conditions. The SDK performs silent liveness detection according to your settings.
4. Pop out the view controller with navigation bar.
5. Implement the callback method in STSilentLivenessDetectorDelegate.
6. Implement the callback method in STSilentLivenessControllerDelegate.
After successful liveness detection, the SDK will return the corresponding face image and an encrypted binary file. The returned value can be used as a parameter of the public cloud interface for face comparison.
Please refer to the server interface documentation for the specific description of the server interface.
The silent liveness SDK provides different degrees of customization. You can choose to customize the UI as needed. This section of the document will explain in detail.
Parameter
Description
setDetectTimeout
Timeout time
setPassConditionMinDuration
Minimum time needed to pass the detection
setPassConditionMinFrames
Minimum frames needed to pass the detection
FaceDistanceRateWithFarRate
Maximum distance to the face
FaceDistanceRateWithCloseRate
Minimum distance to the face
setHackThreshold
Hack (Spoofing) threshold
setIlluminationFilterEnable
Enable/disable illumination detection
setBlurryFilterEnable
Enable/disable blurriness detection
setEyeOpenFilterEnable
Enable/disable eye open detection
setOcclusionEnable
Enable/disable occlusion of face parts detection
Customization option
Customization content
Specific introduction
No customization
No customized content
Direct use of the liveness detection SDK
For integration steps, please refer to: Interface call flow
Partial customization
Modify the basic elements of the interface, including:
View Layout
Modify pictures, text, buttons, background color, etc.
Add or hide other interface elements
1. Integrate the standard silent liveness SDK 2. Modify or replace resource files as follows: 1) //Modify the interface layout, picture elements, prompt text:- (void)setupUI 2)//Modify the image resource path: libSTSilentLivenessController/st_silent_liveness_resource.bundle/ images
Full customization
UI redesign
1 Integrate standard silent liveness SDK 2 Rewrite the STSilentLivenessView class