Importing required libraries and files
Link Binary With Libraries
to add required frameworks (libraries) that the SDK depends on as below:├──HuiYanEKYCVerification.framework
├──tnn.framework
├──tnnliveness.framework
├──YTCommonLiveness.framework
├──YTFaceAlignmentTinyLiveness.framework
├──YTFaceDetectorLiveness.framework
├──YTFaceLiveReflect.framework
├──YTFaceTrackerLiveness.framework
├──YTPoseDetector.framework
├──YtSDKKitActionLiveness.framework
├──YtSDKKitFramework.framework
├──YtSDKKitOcrVideoIdent.framework
├──YtSDKKitReflectLiveness.framework
└──YtSDKKitSilentLiveness.framework
├── HKOCRSDK.framework
├── tiny_opencv2.framework
└── YtSDKKitOcrVideoIdent.framework
Link Binary With Libraries
to add system frameworks.└── Accelerate.framework
└── CoreML.framework
Copy Bundle Resources
to add bundle files.└── face-tracker-v001.bundle
└── huiyan_verification.bundle
└── ytsdkviidres.bundle
Set Build Phases
.
Click Other Linker Flags
to add -ObjC.
Integrate .m files. It is necessary to set the file extension as .mm
, or change the file type to Objective-C++ Source
.
Set permissions
As the SDK requires a camera permission, include the following key-value pair in info.plist
of the main project to add the corresponding permission declaration.
<key>Privacy - Camera Usage Description</key>
<string>eKYC SDK needs to access your camera</string>
This API is called when you initialize your app. It is mainly used for some SDK initialization operations.
#import <HuiYanEKYCVerification/VerificationKit.h>
- (void)viewDidLoad {
[[VerificationKit sharedInstance] initWithViewController:self];
}
When you need to start the eKYC process, you just need to call the startVerifiWithConfig
method and set ekycToken
and some other custom fields.
- (IBAction)startVerificationEvent:(id)sender {
NSLog(@"startVerificationEvent");
VerificationConfig *config = [[VerificationConfig alloc] init];
config.licPath = [[NSBundle mainBundle] pathForResource:@"eKYC_license.lic" ofType:nil];
config.languageType = (LanguageType)(selectTag + 1);
config.verAutoTimeOut = 30000;// Set the authentication timeout period
config.hyFaceTimeOut = 15000;// Set the timeout period of a single face authentication operation
config.ekycToken = self.eKYCTokenTextField.text;
[[VerificationKit sharedInstance] startVerifiWithConfig:config withSuccCallback:^(int errorCode, id _Nonnull resultInfo, id _Nullable reserved) {
NSLog(@"ErrCode:%d msg:%@",errorCode,resultInfo);
NSString *showMsg = [NSString stringWithFormat:@"ErrCode:%d msg:%@",errorCode,resultInfo];
[self showAlertViewWithMsg:showMsg];
} withFialCallback:^(int errorCode, NSString * _Nonnull errorMsg, id _Nullable reserved) {
NSLog(@"ErrCode:%d msg:%@ extra:%@",errorCode,errorMsg,reserved);
NSString *showMsg = [NSString stringWithFormat:@"ErrCode:%d msg:%@ extra:%@",errorCode,errorMsg,reserved];
[self showAlertViewWithMsg:showMsg];
}];
}
ekycToken is the unique credential obtained from the server for this eKYC process.
Note: The file "eKYC_license.lic" is the license file obtained from the business or customer service, and you need to place the license file into Copy Bundle Resources
.
You can call this API after you finish operations and no longer need the SDK.
- (void)dealloc {
[VerificationKit clearInstance];
}
For errors similar to the following ones:
Change the property of the SDK file to Objective-C++ Source
.
For the absence of image in the SDK interface:
Select TARGETS -> Build Settings -> Other Linker Flags to configure -ObjC.
For following errors:
Select TARGETS -> Build Phases -> Link Binary With Libraries to add the system library Accelerate.framework.
Was this page helpful?