提交
This commit is contained in:
@@ -0,0 +1,15 @@
|
||||
//
|
||||
// TencentCloudHuiyanSDKFace.h
|
||||
// Pods
|
||||
//
|
||||
// Created by Leon on 2022/11/14.
|
||||
//
|
||||
|
||||
#ifndef TencentCloudHuiyanSDKFace_h
|
||||
#define TencentCloudHuiyanSDKFace_h
|
||||
#import <TencentCloudHuiyanSDKFace/WBFaceError.h>
|
||||
#import <TencentCloudHuiyanSDKFace/WBFaceVerifyConst.h>
|
||||
#import <TencentCloudHuiyanSDKFace/WBFaceVerifyCustomerService.h>
|
||||
#import <TencentCloudHuiyanSDKFace/WBFaceVerifyResult.h>
|
||||
#import <TencentCloudHuiyanSDKFace/WBFaceVerifySDKConfig.h>
|
||||
#endif /* TencentCloudHuiyanSDKFace_h */
|
||||
@@ -0,0 +1,112 @@
|
||||
//
|
||||
// WBFaceError.h
|
||||
// Pods
|
||||
//
|
||||
// Created by pp on 2017/8/15.
|
||||
//
|
||||
//
|
||||
|
||||
#import <UIKit/UIKit.h>
|
||||
/*
|
||||
Domain(错误出现的地方) Code Desc(描述) Reason(详细实际原因)
|
||||
WBFaceErrorDomainInputParams 12000 传入参数为空 传入的xx为空
|
||||
12001 传入的keyLicence不可用 传入的keyLicence不可用
|
||||
12002 身份证格式不正确 身份证格式不正确
|
||||
12003 使用自带对比源,传入参数错误,非base64 传入的srcPhotoString不是base64
|
||||
12004 使用自带对比源,传入参数错误,超过3M 传入的srcPhotoString超过3M
|
||||
12005 sdk资源引入版本不匹配 没有引入资源包或者引入的资源包版本与当前SDK版本不匹配
|
||||
12006 订单号不能为0或者超过32位
|
||||
12007 nonce字符串位数不为32
|
||||
12008 faceid不合法,需要保证faceid与接口对应
|
||||
12009 定制化SDK生成参数失败
|
||||
12010 定制化参数校验错误
|
||||
12011 当前版本意愿性表达服务暂不支持
|
||||
WBFaceErrorDomainLoginNetwork 22100 网络异常 登陆时网络异常(请求未到达后台)
|
||||
22200 网络异常 登陆时后台返回参数有误(请求到达后台)
|
||||
|
||||
WBFaceErrorDomainLoginServer 其他 透传后台错误码(请参考后台错误) 例如签名问题等等
|
||||
|
||||
|
||||
WBFaceErrorDomainGetInfo 32100 网络异常 获取数字/活体类型/光线阈值,网络异常(请求未到达后台)
|
||||
32200 网络异常 获取数字/活体类型/光线阈值,后台返回参数有误(请求到达后台)
|
||||
|
||||
|
||||
WBFaceErrorDomainNativeProcess 42000 用户取消 回到后台/点击home/左上角/上传时左上角 取消
|
||||
42001 网络环境不满足认证需求 无网络/2g网络
|
||||
42002 权限异常,未获取权限 相机/麦克风/read phone/external storage
|
||||
42003 相机运行中出错
|
||||
42004 视频录制中出错 不能存/启动失败/结束失败
|
||||
42005 请勿晃动人脸,保持姿势 未获取到最佳图片
|
||||
42006 视频大小不满足要求 视频大小不满足要求
|
||||
42007 超时 预检测/动作活体
|
||||
42008 检测中人脸移出框外 活体/数字/反光
|
||||
42009 光线活体本地错误
|
||||
42010 风险控制超出次数 用户重试太多次
|
||||
42011 没有检测到读数声音 数字活体过程中没有发声
|
||||
42012 模型初始化失败
|
||||
42013 意愿模块初始化失败
|
||||
42015 登录态失效
|
||||
42016 请求异常
|
||||
42101 音频录制中出错
|
||||
42102 没有检测到麦克风声音
|
||||
42103 播报音频文件加载失败
|
||||
42104 麦克风被占用,音频播报失败
|
||||
42105 视频录制中出错
|
||||
42106 音量过低,用户主动退出
|
||||
42107 点头检测超时
|
||||
WBFaceErrorDomainCompareNetwork 52100 网络异常 对比时,网络异常(请求未到达后台)
|
||||
52200 网络异常 对比时,后台返回参数有误(请求到达后台)
|
||||
|
||||
WBFaceErrorDomainCompareServer 其他 透传后台错误码
|
||||
*/
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
/*
|
||||
错误domain划分成两类:
|
||||
|
||||
1. 出现在登录时, 通过调用startXXXX 方法的failure block进行回调返回:
|
||||
WBFaceErrorDomainInputParams, WBFaceErrorDomainLoginNetwork, WBFaceErrorDomainLoginServer
|
||||
|
||||
|
||||
2. 人脸服务结果返回(封装在WBFaceVerifyResult中):
|
||||
WBFaceErrorDomainGetInfo, WBFaceErrorDomainNativeProcess, WBFaceErrorDomainCompareNetwork, WBFaceErrorDomainCompareServer
|
||||
*/
|
||||
|
||||
/* 登录时传入参数有误 */
|
||||
UIKIT_EXTERN NSString *const WBFaceErrorDomainInputParams;
|
||||
/* 登录时网络请求错误 */
|
||||
UIKIT_EXTERN NSString *const WBFaceErrorDomainLoginNetwork;
|
||||
/* 登录时后台拒绝登录, 具体参考后台word版本错误码, 这里直接透传 */
|
||||
UIKIT_EXTERN NSString *const WBFaceErrorDomainLoginServer;
|
||||
/* 拉取有效信息时候网络错误 */
|
||||
UIKIT_EXTERN NSString *const WBFaceErrorDomainGetInfo;
|
||||
/* native本地在活体检测中, 某些原因导致错误 */
|
||||
UIKIT_EXTERN NSString *const WBFaceErrorDomainNativeProcess;
|
||||
/* 上送后台比对时,网络错误 */
|
||||
UIKIT_EXTERN NSString *const WBFaceErrorDomainCompareNetwork;
|
||||
/* 后台比对完成,返回比对结果的错误原因*/
|
||||
UIKIT_EXTERN NSString *const WBFaceErrorDomainCompareServer;
|
||||
/* 后台比对未完成,返回失败的错误原因*/
|
||||
UIKIT_EXTERN NSString *const WBFaceErrorDomainServerFailed;
|
||||
|
||||
@interface WBFaceError: NSObject
|
||||
/**
|
||||
错误发生的地方, 具体的发生地方由上面定义的 WBFaceErrorDomainXXXX 指定
|
||||
*/
|
||||
@property (nonatomic, readonly, copy) NSString *domain;
|
||||
/**
|
||||
每个domain中有相应的错误代码, 具体的错误代码见
|
||||
*/
|
||||
@property (nonatomic, readonly, assign) NSInteger code; //错误代码
|
||||
@property (nonatomic, readonly, copy) NSString *desc; //获取本地化描述
|
||||
@property (nonatomic, readonly, copy) NSString *reason; // 错误出现的真实原因原因
|
||||
@property (nonatomic, readonly, copy) NSDictionary * _Nullable otherInfo;// 预留接口
|
||||
|
||||
|
||||
+ (instancetype)errorWithDomain:(NSString *)domain code:(NSInteger)code desc:(NSString *)desc;
|
||||
+ (instancetype)errorWithDomain:(NSString *)domain code:(NSInteger)code desc:(NSString *)desc reason:(NSString *)reason;
|
||||
+ (instancetype)errorWithDomain:(NSString *)domain code:(NSInteger)code desc:(NSString *)desc reason:(NSString *)reason otherInfo:(nullable NSDictionary *)otherInfo;
|
||||
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
||||
@@ -0,0 +1,42 @@
|
||||
//
|
||||
// WBFaceVerifyConst.h
|
||||
// Pods
|
||||
//
|
||||
// Created by pp on 2017/7/31.
|
||||
//
|
||||
//
|
||||
#import <UIKit/UIKit.h>
|
||||
#ifndef WBFaceVerifyConst_h
|
||||
#define WBFaceVerifyConst_h
|
||||
#define WBCloudReflectionFaceVerifyVersion @"8.7.0"
|
||||
|
||||
UIKIT_EXTERN NSString *const WBCloudFaceVerifySDKVersion;
|
||||
|
||||
/**
|
||||
SDK使用的主题风格
|
||||
|
||||
- WBFaceVerifyThemeDarkness: 暗黑色系主题
|
||||
- WBFaceVerifyThemeLightness: 明亮色系主题
|
||||
- WBFaceVerifyThemeCustom: 自定义主题,通过修改bundle中的custom.json实现自定义
|
||||
*/
|
||||
typedef NS_ENUM(NSInteger, WBFaceVerifyTheme) {
|
||||
WBFaceVerifyThemeDarkness = 0,
|
||||
WBFaceVerifyThemeLightness,
|
||||
WBFaceVerifyThemeCustom,
|
||||
};
|
||||
|
||||
typedef NS_ENUM(NSInteger, WBFaceVerifyLanguage) {
|
||||
WBFaceVerifyLanguage_ZH_CN = 0, //简体中文
|
||||
WBFaceVerifyLanguage_ZH_HK, //繁体中文
|
||||
WBFaceVerifyLanguage_EN, //英语
|
||||
WBFaceVerifyLanguage_ID, //印尼语
|
||||
WBFaceVerifyLanguage_JA, //日语
|
||||
WBFaceVerifyLanguage_KO, //韩语
|
||||
WBFaceVerifyLanguage_TH //泰语
|
||||
};
|
||||
|
||||
typedef NS_ENUM(NSInteger, WBFaceCustomTipsLoc) {
|
||||
WBFaceCustomTipsLoc_Bottom = 0, //提示语在下
|
||||
WBFaceCustomTipsLoc_Top,
|
||||
};
|
||||
#endif /* WBFaceVerifyConst_h */
|
||||
@@ -0,0 +1,177 @@
|
||||
//
|
||||
// WBFaceVerifyCustomerService.h
|
||||
// WBFaceV2
|
||||
//
|
||||
// Created by tank on 25/10/2016.
|
||||
// Copyright © 2016 tencent. All rights reserved.
|
||||
//
|
||||
|
||||
/**
|
||||
注意拉起页面的方式:
|
||||
|
||||
SDK会创建一个UIWindow覆盖在当前界面,并在新创建的UIWindow界面进行人脸认证,并且可以通过实现 wbfaceVerifyServiceGetWindowLevel 代理方法,传入创建的UIWindow的windowLevel, 传入的windowLevel必须是1~999, 默认情况如果不实现 wbfaceVerifyServiceGetWindowLevel 方法,windowLevel = UIWindowLevelNormal + 1
|
||||
*/
|
||||
|
||||
|
||||
#import <UIKit/UIKit.h>
|
||||
#import "WBFaceVerifyConst.h"
|
||||
#import "WBFaceVerifySDKConfig.h"
|
||||
#import "WBFaceVerifyResult.h"
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
|
||||
|
||||
// SDK在运行结束退出时候会发出通知. 具体的通知内容可以见delegate方法wbfaceVerifyCustomerServiceDidFinished:中的注释
|
||||
UIKIT_EXTERN NSString *const WBFaceVerifyCustomerServiceDidFinishedNotification;
|
||||
|
||||
@class WBFaceVerifyCustomerService;
|
||||
/**
|
||||
处理刷脸回调
|
||||
*/
|
||||
@protocol WBFaceVerifyCustomerServiceDelegate <NSObject>
|
||||
@optional
|
||||
-(void)wbfaceVerifyCustomerServiceWillUploadBestImage:(UIImage *)bestImage;
|
||||
|
||||
@required
|
||||
-(void)wbfaceVerifyCustomerServiceDidFinishedWithFaceVerifyResult:(WBFaceVerifyResult *)faceVerifyResult;
|
||||
@end
|
||||
|
||||
@interface WBFaceVerifyCustomerService : NSObject
|
||||
@property (nullable,nonatomic,weak) id<WBFaceVerifyCustomerServiceDelegate> delegate;
|
||||
@property (nonatomic, assign, readonly) BOOL isService;
|
||||
|
||||
/*
|
||||
全局唯一单例
|
||||
*/
|
||||
+(instancetype)sharedInstance;
|
||||
|
||||
/*
|
||||
初始化云刷脸sdk,仅做参数初始化与登陆,不拉起刷脸页面
|
||||
登陆有时效性,建议在登陆完成后success回调中拉起刷脸页面!!
|
||||
登陆过程为异步操作,多次登陆以最后一次收到的结果为准!!
|
||||
|
||||
此SDK接口中
|
||||
合作方后台开发需要通过后台接口获取sign,
|
||||
然后根据自带比对源接口, 通过后台接口获取faceId!!!!(native端无需传入自带比对源图)
|
||||
|
||||
*** faceId为空时,启用仅活体检测服务,不做比对 !!!
|
||||
|
||||
注意, 请使用 dispatch_async(dispatch_get_main_queue(), ^{ }); 异步调用SDK的入口方法
|
||||
|
||||
@param userid 用户唯一标识, 由合作方自行定义(具体要求,参考word接入文档)
|
||||
@param nonce 满足接入要求的32位随机数(具体要求,参考word接入文档)
|
||||
@param sign 满足接入要求的40位签名值(具体要求,参考word接入文档)
|
||||
@param appid 腾讯服务分配的appid
|
||||
@param orderNo 每次人脸身份认证请求的唯一订单号: 建议为32位字符串(不超过32位)
|
||||
@param apiVersion 后台api接口版本号(不是SDK的版本号),默认请填写@"1.0.0"
|
||||
@param licence 腾讯给合作方派发的前端使用的licence(该licence同app当前使用的bundle id绑定)
|
||||
@param faceId 合作方必须要先在获取faceId的接口里送入用户自带比对源图片信息,得到相应的faceId后,再送入sdk!!!!(参考word接入文档)
|
||||
*** faceId为空时,启用仅活体检测服务,不做比对 !!!
|
||||
@param sdkConfig SDK基础配置项目
|
||||
@param success 服务登录成功回调,登录成功以后开始进行活体和检测服务
|
||||
@param failure 服务登录失败回调,具体参考错误码文档(参考word接入文档)
|
||||
*/
|
||||
-(void)initSDKWithUserId:(NSString *)userid
|
||||
nonce:(NSString *)nonce
|
||||
sign:(NSString *)sign
|
||||
appid:(NSString *)appid
|
||||
orderNo:(NSString *)orderNo
|
||||
apiVersion:(NSString *)apiVersion
|
||||
licence:(NSString *)licence
|
||||
faceId:(nullable NSString *)faceId
|
||||
sdkConfig:(WBFaceVerifySDKConfig *)sdkConfig
|
||||
success:(void (^)(void))success
|
||||
failure:(void (^)(WBFaceError * _Nonnull error))failure;
|
||||
|
||||
/*
|
||||
Plus级SDK核身入口,注意传入的faceId不能为空,否则会报failure
|
||||
|
||||
@param userid 用户唯一标识, 由合作方自行定义(具体要求,参考word接入文档)
|
||||
@param nonce 满足接入要求的32位随机数(具体要求,参考word接入文档)
|
||||
@param sign 满足接入要求的40位签名值(具体要求,参考word接入文档)
|
||||
@param appid 腾讯服务分配的appid
|
||||
@param orderNo 每次人脸身份认证请求的唯一订单号: 建议为32位字符串(不超过32位)
|
||||
@param apiVersion 后台api接口版本号(不是SDK的版本号),默认请填写@"1.0.0"
|
||||
@param licence 腾讯给合作方派发的前端使用的licence(该licence同app当前使用的bundle id绑定)
|
||||
@param faceId 合作方必须要先获取*增强级*faceId,再送入sdk,不允许为空(参考word接入文档)
|
||||
@param sdkConfig SDK基础配置项目
|
||||
@param success 服务登录成功回调,登录成功以后开始进行活体和检测服务
|
||||
@param failure 服务登录失败回调,具体参考错误码文档(参考word接入文档)
|
||||
*/
|
||||
- (void)initPlusSDKWithUserId:(NSString *)userid
|
||||
nonce:(NSString *)nonce
|
||||
sign:(NSString *)sign
|
||||
appid:(NSString *)appid
|
||||
orderNo:(NSString *)orderNo
|
||||
apiVersion:(NSString *)apiVersion
|
||||
licence:(NSString *)licence
|
||||
faceId:(nullable NSString *)faceId
|
||||
sdkConfig:(WBFaceVerifySDKConfig *)sdkConfig
|
||||
success:(void (^)(void))success
|
||||
failure:(void (^)(WBFaceError * _Nonnull error))failure;
|
||||
|
||||
/*
|
||||
增强级SDK核身入口,注意传入的faceId不能为空,且必须为增强faceId,否则会报failure
|
||||
|
||||
@param userid 用户唯一标识, 由合作方自行定义(具体要求,参考word接入文档)
|
||||
@param nonce 满足接入要求的32位随机数(具体要求,参考word接入文档)
|
||||
@param sign 满足接入要求的40位签名值(具体要求,参考word接入文档)
|
||||
@param appid 腾讯服务分配的appid
|
||||
@param orderNo 每次人脸身份认证请求的唯一订单号: 建议为32位字符串(不超过32位)
|
||||
@param apiVersion 后台api接口版本号(不是SDK的版本号),默认请填写@"1.0.0"
|
||||
@param licence 腾讯给合作方派发的前端使用的licence(该licence同app当前使用的bundle id绑定)
|
||||
@param faceId 合作方必须要先获取*增强级*faceId,再送入sdk,不允许为空(参考word接入文档)
|
||||
@param sdkConfig SDK基础配置项目
|
||||
@param success 服务登录成功回调,登录成功以后开始进行活体和检测服务
|
||||
@param failure 服务登录失败回调,具体参考错误码文档(参考word接入文档)
|
||||
*/
|
||||
-(void)initAdvanceSDKWithUserId:(NSString *)userid
|
||||
nonce:(NSString *)nonce
|
||||
sign:(NSString *)sign
|
||||
appid:(NSString *)appid
|
||||
orderNo:(NSString *)orderNo
|
||||
apiVersion:(NSString *)apiVersion
|
||||
licence:(NSString *)licence
|
||||
faceId:(nonnull NSString *)faceId
|
||||
sdkConfig:(WBFaceVerifySDKConfig *)sdkConfig
|
||||
success:(void (^)(void))success
|
||||
failure:(void (^)(WBFaceError * _Nonnull error))failure;
|
||||
|
||||
/**
|
||||
以上一次的登陆结果拉起刷脸页面,必须先登录再拉起刷脸页面
|
||||
|
||||
@return 拉起是否成功
|
||||
*/
|
||||
- (BOOL)startWbFaceVeirifySdk;
|
||||
|
||||
#pragma mark - 意愿性表达接口
|
||||
/*
|
||||
意愿性SDK入口,注意传入的faceId不能为空
|
||||
|
||||
@param userid 用户唯一标识, 由合作方自行定义(具体要求,参考word接入文档)
|
||||
@param nonce 满足接入要求的32位随机数(具体要求,参考word接入文档)
|
||||
@param sign 满足接入要求的40位签名值(具体要求,参考word接入文档)
|
||||
@param appid 腾讯服务分配的appid
|
||||
@param orderNo 每次人脸身份认证请求的唯一订单号: 建议为32位字符串(不超过32位)
|
||||
@param apiVersion 后台api接口版本号(不是SDK的版本号),默认请填写@"1.0.0"
|
||||
@param licence 腾讯给合作方派发的前端使用的licence(该licence同app当前使用的bundle id绑定)
|
||||
@param faceId 合作方必须要先获取*增强级*faceId,再送入sdk,不允许为空(参考word接入文档)
|
||||
@param sdkConfig SDK基础配置项目
|
||||
@param success 服务登录成功回调,登录成功以后开始进行活体和检测服务
|
||||
@param failure 服务登录失败回调,具体参考错误码文档(参考word接入文档)
|
||||
*/
|
||||
-(void)initWillSDKWithUserId:(NSString *)userid
|
||||
nonce:(NSString *)nonce
|
||||
sign:(NSString *)sign
|
||||
appid:(NSString *)appid
|
||||
orderNo:(NSString *)orderNo
|
||||
apiVersion:(NSString *)apiVersion
|
||||
licence:(NSString *)licence
|
||||
faceId:(nonnull NSString *)faceId
|
||||
sdkConfig:(WBFaceVerifySDKConfig *)sdkConfig
|
||||
success:(void (^)(void))success
|
||||
failure:(void (^)(WBFaceError * _Nonnull error))failure;
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
||||
@@ -0,0 +1,141 @@
|
||||
//
|
||||
// WBFaceVerifyResult.h
|
||||
// Pods
|
||||
//
|
||||
// Created by pp on 2017/8/22.
|
||||
//
|
||||
//
|
||||
|
||||
#import <UIKit/UIKit.h>
|
||||
#import "WBFaceError.h"
|
||||
#import "WBFaceVerifyConst.h"
|
||||
|
||||
@interface WBFaceWillModeResult : NSObject
|
||||
/*
|
||||
核身结果的对应错误码
|
||||
*/
|
||||
@property (nonatomic, copy, readonly) NSString *faceCode;
|
||||
/*
|
||||
核身结果的对应错误描述
|
||||
*/
|
||||
@property (nonatomic, copy, readonly) NSString *faceMsg;
|
||||
/*
|
||||
意愿性结果的对应错误码
|
||||
*/
|
||||
@property (nonatomic, copy, readonly) NSString *willCode;
|
||||
/*
|
||||
意愿性结果的对应错误描述
|
||||
*/
|
||||
@property (nonatomic, copy, readonly) NSString *willMsg;
|
||||
|
||||
@property (nonatomic, strong, readonly) NSURL *videoURL;
|
||||
|
||||
@end
|
||||
|
||||
@interface WBFaceSimpleModeResult : NSObject
|
||||
|
||||
/**
|
||||
结果对应的订单号
|
||||
*/
|
||||
@property (nonatomic, copy, readonly) NSString *orderNo;
|
||||
|
||||
/**
|
||||
接下来用于人脸对比的安全性参数
|
||||
*/
|
||||
@property (nonatomic, copy, readonly) NSString *encryptAESKey;
|
||||
|
||||
/**
|
||||
视频编码
|
||||
*/
|
||||
@property (nonatomic, copy, readonly) NSString *userVideoString;
|
||||
|
||||
/**
|
||||
使用传入publickey加密过的AES
|
||||
*/
|
||||
@property (nonatomic, copy, readonly) NSString *videoEncryptAESKey;
|
||||
/**
|
||||
用于后面进行人脸比对的数据参数
|
||||
*/
|
||||
@property (nonatomic, copy, readonly) NSString *identifyStr;
|
||||
|
||||
@end
|
||||
|
||||
/*
|
||||
增强级结果,具体参数含义参考后台返回字段,结果为透传
|
||||
*/
|
||||
@interface WBFaceRiskInfo : NSObject
|
||||
@property (nonatomic, copy, readonly) NSString *deviceInfoLevel;
|
||||
@property (nonatomic, copy, readonly) NSString *deviceInfoTag;
|
||||
@property (nonatomic, copy, readonly) NSString *riskInfoLevel;
|
||||
@property (nonatomic, copy, readonly) NSString *riskInfoTag;
|
||||
@end
|
||||
/**
|
||||
人脸服务返回结果对象
|
||||
*/
|
||||
@interface WBFaceVerifyResult : NSObject
|
||||
/**
|
||||
人脸比对结果是否通过:
|
||||
|
||||
YES: 表示人脸服务通过
|
||||
NO: 表示人脸服务不通过
|
||||
*/
|
||||
@property (nonatomic, assign, readonly) BOOL isSuccess;
|
||||
|
||||
/**
|
||||
结果对应的订单号
|
||||
*/
|
||||
@property (nonatomic, copy, readonly) NSString *orderNo;
|
||||
|
||||
/**
|
||||
isSuccess == YES 时, sign有值, 通过该sign可以去后台拉取本次人脸服务的照片,视频存证
|
||||
isSuccess == NO 时, sign 无意义
|
||||
*/
|
||||
@property (nonatomic, copy, readonly) NSString * sign;
|
||||
|
||||
/**
|
||||
活体检测服务得分
|
||||
|
||||
isSuccess == YES 时, liveRate 有值:
|
||||
1. liveRate 可能是 @"分数为空", 这种情况具体咨询合作方
|
||||
2. float类型的字符串, 请调用 [liveRate floatValue] 获取具体分数
|
||||
isSuccess == NO 时, liveRate 无意义
|
||||
*/
|
||||
@property (nonatomic, copy, readonly) NSString * liveRate;
|
||||
|
||||
/**
|
||||
人脸比对服务得分
|
||||
|
||||
isSuccess == YES 时, similarity 有值:
|
||||
1. similarity 可能是 @"分数为空", 这种情况具体咨询合作方
|
||||
2. float类型的字符串, 请调用 [similarity floatValue] 获取具体分数
|
||||
isSuccess == NO 时, similarity 无意义
|
||||
*/
|
||||
@property (nonatomic, copy, readonly) NSString * similarity;
|
||||
|
||||
/**
|
||||
人脸比对图片之一
|
||||
|
||||
isSuccess == YES 时, 该属性是上送比对图片之一UIImage的base64编码字符串(图片格式是jpg)
|
||||
|
||||
isSuccess == NO 时, 该属性为nil
|
||||
*/
|
||||
@property (nonatomic, copy, readonly) NSString * userImageString;
|
||||
|
||||
/**
|
||||
isSuccess == YES 时候, error 无意义
|
||||
isSuccess == NO 时, error中存储的具体错误信息,参考 WBFaceError.h
|
||||
*/
|
||||
@property (nonatomic, strong, readonly) WBFaceError * error;
|
||||
|
||||
#pragma mark - 非标专用返回参数
|
||||
|
||||
@property (nonatomic, strong, readonly) WBFaceSimpleModeResult *simpleModeResult;
|
||||
|
||||
#pragma mark - 增强SDK专用参数
|
||||
@property (nonatomic, strong, readonly) WBFaceRiskInfo *riskInfo;
|
||||
|
||||
#pragma mark - 意愿性SDK返回参数
|
||||
@property (nonatomic, strong, readonly) WBFaceWillModeResult *willModeResult;
|
||||
|
||||
-(NSString *)description;
|
||||
@end
|
||||
@@ -0,0 +1,228 @@
|
||||
//
|
||||
// WBFaceVerifySDKConfig.h
|
||||
// Pods
|
||||
//
|
||||
// Created by pp on 2017/8/2.
|
||||
//
|
||||
//
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
#import "WBFaceVerifyConst.h"
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
typedef NS_ENUM(NSUInteger, WBCompareType) {
|
||||
/// 活体+比对
|
||||
WBCompareTypeLiveCompare,
|
||||
/// 仅活体
|
||||
WBCompareTypeLive,
|
||||
};
|
||||
|
||||
/**
|
||||
人脸识别SDK 基础配置类
|
||||
*/
|
||||
@interface WBFaceVerifySDKConfig : NSObject
|
||||
|
||||
/// 是否使用非标模式, 默认为NO(具体含义请咨询技术支持)
|
||||
/// - IMPORTANT: 一般不需要开启, 开启前请咨询技术支持
|
||||
/// - IMPORTANT: 使用原WBCloudFaceVerifySimpleSDK升级过来的,务必打开此项
|
||||
@property (nonatomic, assign) BOOL useSimpleMode;
|
||||
|
||||
#pragma mark - common
|
||||
/**
|
||||
sdk中拉起人脸活体识别界面中使用UIWindow时的windowLevel配置,默认配置是1 + UIWindowLevelNormal
|
||||
|
||||
如果接入放app中有其他自定义UIWindow, 为了防止界面覆盖,可以酌情设置该参数
|
||||
*/
|
||||
@property (nonatomic, assign) NSUInteger windowLevel;
|
||||
|
||||
/**
|
||||
人脸识别服务结果页是否展示配置项 - 是否展示人脸对比成功界面 -> 建议关闭
|
||||
|
||||
default: NO
|
||||
*/
|
||||
@property (nonatomic, assign) BOOL showSuccessPage DEPRECATED_MSG_ATTRIBUTE("SDK 已移除结果页, 若有需要可参考 Demo 实现");
|
||||
|
||||
/**
|
||||
人脸识别服务结果页是否展示配置项 - 是否展示人脸对比失败界面 -> 建议关闭
|
||||
|
||||
default: NO
|
||||
*/
|
||||
@property (nonatomic, assign) BOOL showFailurePage DEPRECATED_MSG_ATTRIBUTE("SDK 已移除结果页, 若有需要可参考 Demo 实现");
|
||||
|
||||
/**
|
||||
人脸识别服务是否进行通过录像, 从而进行视频存证
|
||||
|
||||
default: NO
|
||||
*/
|
||||
@property (nonatomic, assign) BOOL recordVideo;
|
||||
|
||||
/**
|
||||
人脸识别服务是否强制校验视频,当视频为空时报错
|
||||
可能会出现在部分性能差的机型
|
||||
|
||||
default: NO
|
||||
*/
|
||||
@property (nonatomic, assign) BOOL checkVideo;
|
||||
|
||||
/**
|
||||
是否由SDK内部处理sdk网络请求的cookie
|
||||
|
||||
默认值: YES
|
||||
*/
|
||||
@property (nonatomic, assign) BOOL manualCookie;
|
||||
|
||||
/**
|
||||
多语言配置
|
||||
默认中文,当使用其他语言时,强制静音
|
||||
*/
|
||||
@property (nonatomic, assign) WBFaceVerifyLanguage language;
|
||||
/**
|
||||
人脸识别页面中的主题风格, 需要配合不同资源包使用:
|
||||
WBFaceVerifyThemeDarkness - 暗灰主题
|
||||
WBFaceVerifyThemeLightness - 明亮主题
|
||||
- 当前意愿性表达只支持明亮主题, 若使用了意愿性表达功能则强制设定为明亮主题
|
||||
*/
|
||||
@property (nonatomic, assign) WBFaceVerifyTheme theme;
|
||||
|
||||
/**
|
||||
是否静音
|
||||
默认值:YES
|
||||
*/
|
||||
@property (nonatomic, assign) BOOL mute;
|
||||
|
||||
/**
|
||||
刷脸服务走iPv6协议栈
|
||||
默认:YES
|
||||
*/
|
||||
@property (nonatomic, assign) BOOL isIpv6 DEPRECATED_ATTRIBUTE;
|
||||
|
||||
/**
|
||||
是否海外用户
|
||||
默认:NO
|
||||
*/
|
||||
@property (nonatomic, assign) BOOL isAbroad;
|
||||
|
||||
/**
|
||||
是否打开日志上报
|
||||
1打开 0关闭 -1由SDK内部决定
|
||||
默认:-1
|
||||
*/
|
||||
@property (nonatomic, assign) NSInteger enableTrackLog DEPRECATED_ATTRIBUTE;
|
||||
/*
|
||||
送入自定义提示文案的位置
|
||||
默认:WBFaceCustomTipsLoc_Bottom
|
||||
*/
|
||||
@property (nonatomic, assign) WBFaceCustomTipsLoc tipsLoc;
|
||||
|
||||
/*
|
||||
检测过程中展示的文案
|
||||
默认为空
|
||||
*/
|
||||
@property (nonatomic, copy) NSString *customTipsInDetect;
|
||||
|
||||
/*
|
||||
上传过程中展示的文案
|
||||
默认为空
|
||||
*/
|
||||
@property (nonatomic, copy) NSString *customTipsInUpload;
|
||||
|
||||
/*
|
||||
底部提示文案,长度不超过70字
|
||||
*/
|
||||
@property (nonatomic, copy, nullable) NSString *bottomCustomTips;
|
||||
/*
|
||||
底部提示文案(富文本版本),长度不超过70字
|
||||
*/
|
||||
@property (nonatomic, copy, nullable) NSAttributedString *bottomCustomAttributedTips;
|
||||
/*
|
||||
退出二次确认UI配置
|
||||
*/
|
||||
@property (nonatomic, copy) NSString *exitAlertTitle; //标题
|
||||
@property (nonatomic, copy) NSString *exitAlertMessage; //内容
|
||||
@property (nonatomic, copy) NSString *exitAlertYES; //确认按钮
|
||||
@property (nonatomic, copy) NSString *exitAlertNO; //取消按钮
|
||||
|
||||
/*
|
||||
如果有使用苹果分屏模式(UIWindowScene),打开此开关
|
||||
Xcode11新建工程有使用Scene,可以参考资料自行调整
|
||||
默认为NO
|
||||
*/
|
||||
@property (nonatomic, assign) BOOL useWindowSecene;
|
||||
|
||||
/// 使用 hostVC 以实现基于 Modal 的 transition, **一般不需要配置, 仅建议 native 开发者使用**
|
||||
/// - IMPORTANT: **一般不需要配置, 仅建议 native 开发者酌情使用**
|
||||
@property (nonatomic, weak, nullable) UIViewController *hostVC;
|
||||
|
||||
/**
|
||||
TencentCloudHuiyanSDKFace.bundle 的目录路径,不包含bundle本身(仅当需要自己下发资源时配置,本地资源无需配置)
|
||||
!!!重要:此目录下必须包含TencentCloudHuiyanSDKFace.bundle 文件,否则无法拉起SDK
|
||||
*/
|
||||
@property (nonatomic, copy) NSString *bundlePath;
|
||||
|
||||
/**
|
||||
face-tracker-v003.bundle 的目录路径
|
||||
|
||||
!!!重要:若有值,此目录下必须包含 face-tracker-v003.bundle 文件,否则无法拉起SDK
|
||||
*/
|
||||
@property (nonatomic, copy, nullable) NSString *faceTrackerBundleDirPath;
|
||||
|
||||
/**
|
||||
face-tracker-v003.bundle 是否经过重新打包, 默认值为 NO, **一般不需要配置**
|
||||
*/
|
||||
@property (nonatomic) BOOL faceTrackerBundleRepackaged;
|
||||
|
||||
/**
|
||||
是否采用增强比对服务,仅增强接口生效,仅活体服务设置为NO
|
||||
默认为 NO
|
||||
*/
|
||||
@property (nonatomic, assign) BOOL useAdvanceCompare;
|
||||
|
||||
/// 服务类型, 默认为 LiveCompare, **一般不需要修改**
|
||||
@property (nonatomic, assign) WBCompareType compareType;
|
||||
|
||||
/**
|
||||
APP是否只允许横屏,非强制横屏的不用设置,否则可能会出现旋转问题
|
||||
@default NO
|
||||
*/
|
||||
@property (nonatomic, assign) BOOL forceOrientation;
|
||||
|
||||
#pragma mark - simple //非标特有字段,标准模式无需设置
|
||||
/**
|
||||
是否返回录制的视频
|
||||
|
||||
default: NO
|
||||
*/
|
||||
@property (nonatomic, assign) BOOL returnVideo;
|
||||
|
||||
/**
|
||||
返回视频加密的公钥,如果不配置则不加密
|
||||
|
||||
需要recordVideo returnVideo同时为YES,才返回加密的视频内容
|
||||
*/
|
||||
@property (nonatomic, copy) NSString *publicKey;
|
||||
|
||||
/**
|
||||
AES加密需要用到的IV
|
||||
*/
|
||||
@property (nonatomic, copy) NSString *aesIV;
|
||||
|
||||
#pragma mark - will //意愿性特有字段,标准模式无需设置
|
||||
@property (nonatomic, assign) BOOL recordWillVideo;
|
||||
|
||||
@property (nonatomic, assign) BOOL checkWillVideo;
|
||||
|
||||
/// 播报音量,值范围(0.1,1]
|
||||
@property (nonatomic, assign) float willVolume;
|
||||
|
||||
/// 当录制意愿视频时,是否同时返回sdk+服务端视频
|
||||
@property (nonatomic, assign) BOOL uploadAndReturnWillVideo;
|
||||
/// 是否允许意愿阶段使用有线耳机, 默认不允许
|
||||
@property (nonatomic, assign) BOOL allowWillHeadset;
|
||||
#pragma mark -
|
||||
/**
|
||||
默认sdk配置
|
||||
*/
|
||||
+(instancetype)sdkConfig;
|
||||
|
||||
@end
|
||||
NS_ASSUME_NONNULL_END
|
||||
@@ -0,0 +1,6 @@
|
||||
framework module TencentCloudHuiyanSDKFace {
|
||||
umbrella header "TencentCloudHuiyanSDKFace.h"
|
||||
|
||||
export *
|
||||
module * { export * }
|
||||
}
|
||||
Binary file not shown.
Reference in New Issue
Block a user