开发版本-developer——01 first commit
This commit is contained in:
+67
@@ -0,0 +1,67 @@
|
||||
//
|
||||
// IOpenNoCaptchaComponent.h
|
||||
// SecurityGuardSDK
|
||||
//
|
||||
// Created by chenkong on 15/4/29.
|
||||
// Copyright (c) 2015年 Li Fengzhong. All rights reserved.
|
||||
//
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
#import <CoreGraphics/CGGeometry.h>
|
||||
|
||||
@protocol IOpenNoCaptchaComponent <NSObject>
|
||||
|
||||
|
||||
/**
|
||||
* 初始化无痕验证模块
|
||||
*
|
||||
* @param appKey 接入应用使用的appkey
|
||||
* @param pageName 页面名称
|
||||
* @param screenWidth 表示屏幕的宽度像素值
|
||||
* @param screenHeight 表示屏幕的高度像素值
|
||||
* @param retryTimes 校验重试次数
|
||||
* @param statusCB 回调函数
|
||||
* @param authCode 二方用户请传nil,三方用户请传AuthCode
|
||||
*/
|
||||
-(void) initNoCaptcha: (NSString*) appKey
|
||||
pageName: (NSString*) pageName
|
||||
width: (int) screenWidth
|
||||
height: (int) screenHeight
|
||||
retry: (int) retryTimes
|
||||
status: (void(^)(NSInteger status, CGPoint pt1, CGPoint pt2, NSString* token, NSString* sig, NSString* sessionID))statusCb
|
||||
authCode: (NSString*) authCode;
|
||||
|
||||
/**
|
||||
* 写入用户触屏打点数据
|
||||
*
|
||||
* @param touchEvent touch的类型
|
||||
* @param pt 打点的坐标
|
||||
*/
|
||||
-(BOOL) putNoCaptchaTraceRecord: (NSInteger) touchEvent
|
||||
point: (CGPoint) pt;
|
||||
|
||||
/**
|
||||
* 请求进行无线验证
|
||||
*
|
||||
* @param appKey 接入应用使用的appkey
|
||||
* @param statusCB 回调函数
|
||||
*/
|
||||
-(void) noCaptchaVerification: (NSString*)appKey
|
||||
status: (void(^)(NSInteger status, CGPoint pt1, CGPoint pt2, NSString* token, NSString* sig, NSString* sessionID))statusCb;
|
||||
|
||||
/**
|
||||
* 前向化请求,验证接口
|
||||
*
|
||||
* @param methodName 需要调用的Top API名;
|
||||
*
|
||||
* @param authInfo 其他需要的信息,以key-v形式存于authInfo中;
|
||||
*
|
||||
* @param timeout 接口调用超时时间,单位秒,最大不超过22,最小不小于1。
|
||||
*
|
||||
*/
|
||||
- (NSString*) noCaptchaForwardAuth: (NSString *) methodName
|
||||
authInfo: (NSDictionary*) authInfo
|
||||
timeout: (NSInteger) timeout;
|
||||
|
||||
|
||||
@end
|
||||
+34
@@ -0,0 +1,34 @@
|
||||
//
|
||||
// OpenNoCaptchaDefine.h
|
||||
// SecurityGuardSDK
|
||||
//
|
||||
// Created by chenkong on 15/4/29.
|
||||
// Copyright (c) 2015年 Li Fengzhong. All rights reserved.
|
||||
//
|
||||
|
||||
//touch event type
|
||||
extern NSInteger const OPEN_TOUCH_TYPE_BEGAN;
|
||||
extern NSInteger const OPEN_TOUCH_TYPE_MOVED;
|
||||
extern NSInteger const OPEN_TOUCH_TYPE_ENDED;
|
||||
|
||||
|
||||
//status code
|
||||
extern NSInteger const OPEN_NC_INIT_SUCCEED; //101 返回两个渲染坐标
|
||||
extern NSInteger const OPEN_NC_VERI_SUCCEED; //102 返回token,sig,sessionId
|
||||
extern NSInteger const OPEN_NC_RETRY; //103 返回两个渲染坐标
|
||||
extern NSInteger const OPEN_NC_SERVER_FAULT; //104 返回token,sig,sessionId
|
||||
|
||||
//error status code
|
||||
extern NSInteger const OPEN_NC_INVALID_PARA; //1201
|
||||
extern NSInteger const OPEN_NC_NO_MEMORY; //1202
|
||||
extern NSInteger const OPEN_NC_NOT_INIT_YET; //1203
|
||||
extern NSInteger const OPEN_NC_QUEUE_FULL; //1204
|
||||
extern NSInteger const OPEN_NC_RETRY_TO_MAX; //1205
|
||||
extern NSInteger const OPEN_NC_HTTP_NO_TOKEN; //1206
|
||||
extern NSInteger const OPEN_NC_HTTP_REQUEST_FAIL; //1207
|
||||
extern NSInteger const OPEN_NC_SERVER_RETURN_ERROR; //1208
|
||||
extern NSInteger const OPEN_NC_VERI_GET_WUA_FAIL; //1209
|
||||
extern NSInteger const OPEN_NC_VERI_GET_TRACE_FAIL; //1210
|
||||
extern NSInteger const OPEN_NC_VERI_APPKEY_MISMATCH; //1211
|
||||
extern NSInteger const OPEN_NC_VERI_SESSION_EXPIRED; //1212
|
||||
extern NSInteger const OPEN_NC_UNKNOWN_ERROR; //1299
|
||||
Reference in New Issue
Block a user