Kebijakan Privasi
Perjanjian Pemrosesan dan Keamanan Data


var FaceIdClient *faceid.Clientfunc init() {// Initialize the client configuration below, where you can specify the timeout duration and other configuration itemsprof := profile.NewClientProfile()prof.HttpProfile.ReqTimeout = 60// TODO Replace with your account's SecretId and SecretKeycredential := cloud.NewCredential("SecretId", "SecretKey")var err error// Initialize the client for calling the HuiYan FaceID serviceFaceIdClient, err = faceid.NewClient(credential, "ap-singapore", prof)if nil != err {log.Fatal("FaceIdClient init error: ", err)}}// ApplySdkVerificationToken obtains the FaceID API Tokenfunc ApplySdkVerificationToken(w http.ResponseWriter, r *http.Request) {log.Println("get face id token")// Step 1: Parse request parameters_ = r.ParseForm()var IdCardType = r.FormValue("IdCardType")var NeedVerifyIdCard = false// Step 2: Initialize the request object and assign values to required parametersrequest := faceid.NewApplySdkVerificationTokenRequest()request.IdCardType = &IdCardTyperequest.NeedVerifyIdCard = &NeedVerifyIdCard// Step 3: Invoke the FaceID service via FaceIdClientresponse, err := FaceIdClient.ApplySdkVerificationToken(request)// Step 4: Process the Tencent Cloud API response and construct the response objectif nil != err {log.Println("error: ", err)_, _ = w.Write([]byte("error"))return}SdkToken := response.Response.SdkTokenapiResp := struct {SdkToken *string}{SdkToken: SdkToken}b, _ := json.Marshal(apiResp)// ... Other business processing code// Step 5: Return the service response_, _ = w.Write(b)}// GetFaceIdResult obtains the FaceID verification resultfunc GetSdkVerificationResult(w http.ResponseWriter, r *http.Request) {// Step 1: ... Parse request parameters_ = r.ParseForm()SdkToken := r.FormValue("SdkToken")// Step 2: Initialize the request object and assign values to required parametersrequest := faceid.NewGetSdkVerificationResultRequest()request.SdkToken = &SdkToken// Step 3: Invoke the FaceID service via FaceIdClientresponse, err := FaceIdClient.GetSdkVerificationResult(request)// Step 4: Process the Tencent Cloud API response and construct the response objectif nil != err {_, _ = w.Write([]byte("error"))return}result := response.Response.ResultapiResp := struct {Result *string}{Result: result}b, _ := json.Marshal(apiResp)// ... Other business processing code// Step 5: Return the service response_, _ = w.Write(b)}func main() {// Register http API pathhttp.HandleFunc("/api/v1/get-token", ApplySdkVerificationToken)http.HandleFunc("/api/v1/get-result", GetSdkVerificationResult)// Listen on porterr := http.ListenAndServe(":8080", nil)if nil != err {log.Fatal("ListenAndServe error: ", err)}
// Set ndk so architecture filtering (taking armeabi-v7a as an example; add arm64-v8a if supported)defaultConfig {ndk {abiFilters 'arm64-v8a'}}dependencies {// Identity verification SDK repositoryimplementation files("libs/ekyc-v1.0.1.2-release.aar")// Identity verification component libraryimplementation files("libs/huiyansdk_android_overseas_1.0.10.5_release.aar")// Face model library (optional): If not imported, specify the external model directory path via EkycHyConfig.setFaceModelPath() (directory name must be face-tracker-v003), and ensure model file integrityimplementation files("libs/huiyanmodels_1.0.1_release.aar")// Ocr component library// OCR model library (optional): If not imported, specify the external model file path via EkycHyConfig.setOcrModelPath() (file name must be subject.iap), and ensure model file integrityimplementation files("libs/OcrSDK-common-model-v1.0.0-release.aar")implementation files("libs/OcrSDK-private-v2.0.0.25-release.aar")// Common component libraryimplementation files("libs/tencent-ai-sdk-youtu-base-1.0.2.1.1-release.aar")implementation files("libs/tencent-ai-sdk-common-1.1.49.8-release.aar")implementation files("libs/tencent-ai-sdk-aicamera-1.0.30.4-release.aar")implementation files("libs/tencent-ai-sdk-network-1.0.2.13-release.aar")// Import the gson third-party libraryimplementation 'com.google.code.gson:gson:2.8.9'}
<!-- SDK required permissions --><uses-permission android:name="android.permission.CAMERA" /><uses-featureandroid:name="android.hardware.camera"android:required="true" /><uses-feature android:name="android.hardware.camera.autofocus" /><uses-permission android:name="android.permission.INTERNET" /><uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
@Overridepublic void onCreate() {super.onCreate();EkycHySdk.init(this);}
EkycHySdk.startEkycCheck() function and pass in the following parameters:// Set startup configurationEkycHyConfig ekycHyConfig = new EkycHyConfig();// Set the license nameekycHyConfig.setLicenseName("ekycLicense.license");ekycHyConfig.setOcrType(OcrRegionType.HK);// If you need to enable the device risk control capability, pass in the lic file and turn on the local switch; if not enabled, no modification is required.ekycHyConfig.setRiskLicenseName("risk.lic");ekycHyConfig.setOpenCheckRiskMode(true);// Custom UI configurationOcrUiConfig config = new OcrUiConfig();ekycHyConfig.setOcrUiConfig(config);// Specific startup verification logic// sdkToken is the unique credential for the current process, obtained from the server.EkycHySdk.startEkycCheck(sdkToken, ekycHyConfig, new EkycHyCallBack() {@Overridepublic void onSuccess(EkycHyResult result) {Log.e(TAG, "result: " + result.toString());runOnUiThread(() -> {Toast.makeText(this.getApplicationContext(), "Verification successful: " + result.toString(), Toast.LENGTH_SHORT).show();});}@Overridepublic void onFail(int errorCode, String errorMsg, String ekycToken) {Log.e(TAG, "code: " + errorCode + " msg: " + errorMsg + " token: " + ekycToken);String msg = "Check failed, code: " + errorCode + " msg: " + errorMsg + " token: " + ekycToken;runOnUiThread(() -> {Toast.makeText(this.getApplicationContext(), msg, Toast.LENGTH_SHORT).show();});}});
├── app│ ├── build.gradle│ ├── libs│ ├── proguard-rules.pro│ └── src│ └── main│ └── assets│ ├── ekycLicense.license│ └── risk.lic
@Overrideprotected void onDestroy() {EkycHySdk.release();super.onDestroy();}
# Objects to be obfuscated-keep class com.google.gson.** {*;}-keep class com.tencent.cloud.** {*;}-keep class com.tencent.youtu.** {*;}-keep class com.tencent.cloud.ocr.** {*;}-keep class com.tencent.cloud.ekyc.** {*;}
// Set the device risk control license file (must be placed in the assets directory)ekycHyConfig.setRiskLicenseName("turing.lic");// Enable device risk control capabilityekycHyConfig.setOpenCheckRiskMode(true);
├── HuiYanEKYCVerification.framework├── tnn.framework├── tnnliveness.framework├── YTCommonLiveness.framework├── YTFaceAlignmentTinyLiveness.framework├── YTFaceDetectorLiveness.framework├── YTFaceLiveReflect.framework├── YTFaceTrackerLiveness.framework├── YTPoseDetector.framework├── YtSDKKitActionLiveness.framework├── YtSDKKitFramework.framework├── YtSDKKitReflectLiveness.framework├── YtSDKKitSilentLiveness.framework├── tiny_opencv2.framework├── HuiYanOverseasSDK.framework├── OcrSDKKit.framework├── TXYCommonDevice.framework├── TXYCommonNetworking.framework├── TXYCommonUtils.framework├── YTCv.framework├── YTImageRefiner.framework├── YtSDKKitFrameworkTool.framework└── YTSm.framework
├── libc++.tbd├── Accelerate.framework└── CoreML.framework
├── face-tracker-v003.bundles├── huiyan_verification.bundle├── HuiYanSDKUI.bundle└── OcrSDK.bundle
Pod::Spec.new do |s|s.name = "CloudHuiYanSDK_FW"s.version = "1.0.0"s.platform = :ios, "9.0"s.summary = 'frameworks and bundle resources for youtu mobile hdr's.homepage = 'xxx's.license = 'MIT's.source = {:git => 'xxx' ,:tag => "#{s.version}"}s.static_framework = trues.compiler_flags = "-ObjC"s.author = {'xxx' => 'xxx'}s.pod_target_xcconfig = {'VALID_ARCHS' =>['arm64']}s.subspec 'Framework' do |framework|framework.frameworks = 'Accelerate'framework.vendored_frameworks = 'Frameworks/*.framework'ends.subspec 'Resource' do |resource|resource.resources = 'Resources/*'endend
├──Project├──CloudHuiYanSDK_FW├───────CloudHuiYanSDK_FW.podspec├───────Frameworks├────────────HuiYanEKYCVerification.framework├────────────tnn.framework├────────────tnnliveness.framework├────────────YTCommonLiveness.framework├────────────YTFaceAlignmentTinyLiveness.framework├────────────YTFaceDetectorLiveness.framework├────────────YTFaceLiveReflect.framework├────────────YTFaceTrackerLiveness.framework├────────────YTPoseDetector.framework├────────────YtSDKKitActionLiveness.framework├────────────YtSDKKitFramework.framework├────────────YtSDKKitReflectLiveness.framework├────────────YtSDKKitSilentLiveness.framework├────────────tiny_opencv2.framework├────────────HuiYanOverseasSDK.framework├────────────OcrSDKKit.framework├────────────TXYCommonDevice.framework├────────────TXYCommonNetworking.framework├────────────TXYCommonUtils.framework├────────────YTCv.framework├────────────YTImageRefiner.framework├────────────YtSDKKitFrameworkTool.framework├────────────YTSm.framework├───────Resources├────────────face-tracker-v003.bundles├────────────huiyan_verification.bundle├────────────HuiYanSDKUI.bundle└────────────OcrSDK.bundle
target 'ProjectName' douse_frameworks!pod 'CloudHuiYanSDK_FW', :path => './CloudHuiYanSDK_FW'end
<key>Privacy - Camera Usage Description</key><string>Requires access to your camera</string>
#import <HuiYanEKYCVerification/VerificationKit.h>- (void)viewDidLoad {[[VerificationKit sharedInstance] initWithViewController:self];}
VerificationConfig *config = [[VerificationConfig alloc] init];config.licPath = [[NSBundle mainBundle] pathForResource:@"eKYC_license.lic" ofType:nil];config.languageType = HY_EKYC_EN;config.ocrAutoTimeout = 30000;//Anti-spoofing timeout settingconfig.livenessAutoTimeout = 15000;//Face single-action timeout settingconfig.ekycToken = @"";[[VerificationKit sharedInstance] startVerifiWithConfig:config withSuccCallback:^(int errorCode, id _Nonnull resultInfo, id _Nullable reserved) {NSLog(@"ErrCode:%d msg:%@",errorCode,resultInfo);} withFialCallback:^(int errorCode, NSString * _Nonnull errorMsg, id _Nullable reserved) {NSLog(@"ErrCode:%d msg:%@ extra:%@",errorCode,errorMsg,reserved);}];
- (void)dealloc {[VerificationKit clearInstance];}
SDK version | Basic edition (SdkVersion: BASIC) | Enhance edition (SdkVersion: ENHANCE) | Plus edition (SdkVersion: PLUS) |
1.0.0.x | ✅ | ❌ | ❌ |
1.0.1.x | ✅ | ✅ | ✅ |
//Configure the SDKVerificationConfig *config = [[VerificationConfig alloc] init];//Set licconfig.licPath = [[NSBundle mainBundle] pathForResource:@"YTFaceSDK.license" ofType:@""];//If device risk control is enabled, a risk control license must be provided. The Enhanced and Plus editions require this configuration to be enabled, while the Basic edition does not.config.openCheckRiskMode = YES;config.riskLicense = [[NSBundle mainBundle] pathForResource:@"turing.license" ofType:@""];
Startup Mode | Corresponding CheckMode value | Mode Description |
Identity verification | 1 | This mode includes the entire process of document recognition, liveness detection, and face comparison. |
Selfie verification | 2 | This mode only includes but covers the entire process of liveness detection and face comparison. |
Liveness detection mode | 3 | This mode only includes the liveness detection process. |
Apakah halaman ini membantu?
Anda juga dapat Menghubungi Penjualan atau Mengirimkan Tiket untuk meminta bantuan.
masukan