HuiYanOSKit
(API class), HuiYanOsConfig
(configuration parameter class), and HuiYanOKitSuccCallback
and HuiYanOKitFailCallback
(result and callback classes).API | Feature Description |
Starts the liveness detection and face comparison process in the FaceID SDK. | |
Releases FaceID SDK resources. |
+ (void)release;
/// Start the liveness detection and face comparison process/// @param faceToken token/// @param kitConfig SDK configuration/// @param succCallback Callback for successful liveness detection and face comparison/// @param failCallback Callback for failed liveness detection and face comparison- (void)startHuiYaneKYC:(NSString *)faceToken withConfig:(HuiYanOsConfig *)kitConfigwitSuccCallback:(HuiYanOKitSuccCallback)succCallbackwithFailCallback:(HuiYanOKitFailCallback)failCallback;
Type | Parameter | Description |
NSSting | faceToken | Liveness detection and face comparison process token |
kitConfig | SDK configuration class | |
succCallback | Callback for successful liveness detection and face comparison | |
failCallback | Callback for failed liveness detection and face comparison |
Type | Parameter | Description |
NSSting | faceToken | Liveness detection and face comparison process token |
NSSting | bestImage | Base64-encoded best frame image returned upon success if best frame return is enabled |
HuiYanOsConfig
is the configuration entity class during eKYC SDK startup, which mainly contains the following attributes:Type | Name | Description | Default Value |
NSString | authLicense | Name of the license file applied for by client for liveness detection and face comparison authorization | Empty |
long | authTimeOutMs | Liveness detection and face comparison timeout period | 10000 ms (10s) |
long | prepareTimeoutMs | Detection timeout period in the preparation stage | 0 |
showTimeOutMode | Stage in which the countdown is displayed | HYShowTimeOutMode_PREPARE | |
BOOL | isDeleteVideoCache | Whether to delete the local cache of the liveness detection and face comparison video | YES |
BOOL | iShowTipsPage | Whether to display the guide page | No |
NSString | userUIBundleName | Custom UI bundle filename; for example, set UserUIBundle for UserUIBundle.bundle | nil |
NSString | userLanguageFileName | Custom languageBundle name; for example, set UseLanguage for UseLanguage.bundle`. | nil |
NSString | userLanguageBundleName | Custom local file name for internationalization; for example, set en for en.lproj . | nil |
languageType | Text language settings inside the SDK | DEFAULT | |
BOOL | isGetBestImg | Whether to get the best frame image | No |
NSString | setLanguageFileName | Language file directory name added in HuiYanSDKUI.bundle has the highest priority by default | nil |
/*** Callback for successful liveness detection and face comparison** @param authResult Liveness detection and face comparison result* @param reserved Reserved*/typedef void (^HuiYanOKitSuccCallback)(HuiYanOsAuthResult * _Nonnull authResult, id _Nullable reserved);
/*** Callback for failed liveness detection and face comparison** @param errCode Error code* @param errMsg Error message* @param reserved Reserved*/typedef void (^HuiYanOKitFailCallback)(int errCode, NSString * _Nonnull errMsg ,id _Nullable reserved);
typedef enum : NSUInteger {DEFAULT = 0,//AutoZH_HANS,//Simplified ChineseZH_HANT,//Traditional ChineseZH_HK,//Traditional Chinese (Hong Kong)ZH_TW,//Traditional Chinese (Taiwan)EN,//EnglishMS,//MalaysianRU,//RussianJA,//JapaneseCUSTOMIZE_LANGUAGE, //Custom language} LanguageType;
typedef NS_OPTIONS(int, HYShowTimeOutMode) {HYShowTimeOutMode_TIMEOUT_HIDDEN = 1 << 0,// Hide the countdown in all stagesHYShowTimeOutMode_PREPARE = 1 << 1,// Preparation stage countdownHYShowTimeOutMode_ACTION = 1 << 3,// Action stage countdown};
Error Codes | Error Code | Error Description |
HY_SUCCESS | 0 | Successful |
HY_INITIALIZATION_PARAMETER_EXCEPTION | 210 | Parameter initialization exception |
HY_BUNDLE_CONFIGURATION_EXCEPTION | 211 | Bundle configuration exception |
HY_YTSDK_CONFIGURATION_EXCEPTION | 212 | YouTu configuration exception |
HY_PLEASE_CALL_FIRST_INIT_API | 213 | Call the API for initialization first |
HY_SDK_AUTH_FAILED | 214 | SDK authorization failure |
HY_USER_VOLUNTARILY_CANCELED | 215 | Manually canceled by user |
HY_YTSDK_LOCAL_AUTH_FAILED | 216 | Local face detection failure of SDK |
HY_CAMERA_OPEN_FAIL | 217 | Failed to enable the camera |
HY_DONOT_SWITCH_APPS | 218 | Do not switch the application during liveness detection and face comparison |
HY_CAMEREA_PERMISSION_EXCEPTION | 219 | Camera permission exception |
HY_SDK_VEDIO_CUT_EXCEPTION | 220 | Failed to clip the video |
HY_LIGHT_DATA_FORMAT_EXCEPTION | 221 | Incorrect light data format |
HY_DETECT_TIMEOUT | 222 | Action detect time out |
HY_LIMIT_SET_PKG_SIZE | 223 | Package over limitaion size |
HY_USE_BACK_CAMERA_WITH_REFLECTIVE_ERROR | 227 | Reflective mode please do not use back camera |
HY_NETWORK_ERROR | 272 | Network error |
HY_PREPARE_TIMEOUT | 300 | Prepare process timeout |
HY_LONGCHECK_TIMEOUT | 301 | Time-consuming detection timeout |
HY_DONOT_ALLOW_RECORDING | 302 | Do not enable video recording during the process |
HY_DONOT_ALLOW_SCREENSHOTS | 303 | Do not enable screen shots during the process |
Was this page helpful?