Skip to content

Commit a62eb58

Browse files
committed
add ios sdk
1 parent e3f7052 commit a62eb58

File tree

26 files changed

+894
-0
lines changed

26 files changed

+894
-0
lines changed

ios/RCTJVerificationModule.xcodeproj/project.pbxproj

Lines changed: 380 additions & 0 deletions
Large diffs are not rendered by default.

ios/RCTJVerificationModule.xcodeproj/project.xcworkspace/contents.xcworkspacedata

Lines changed: 7 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
3+
<plist version="1.0">
4+
<dict>
5+
<key>IDEDidComputeMac32BitWarning</key>
6+
<true/>
7+
</dict>
8+
</plist>
5.43 MB
Binary file not shown.
Lines changed: 114 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,114 @@
1+
//
2+
// EAccount.h
3+
// EAccount
4+
//
5+
// Created by 21CN on 14-4-3.
6+
// Copyright (c) 2014年 21CN. All rights reserved.
7+
//
8+
9+
/*
10+
修订历史:2017、04、26
11+
添加预取号接口:preGetMobileAccessCode
12+
添加新的网关认证的接口:gatewayAuth
13+
删除旧的网关认证接口:gatewayLoginOnly
14+
修改打开免密登录页面接口的参数。
15+
*/
16+
17+
/*
18+
SDK说明:
19+
SDk_ Version: 3.10
20+
build版本号:
21+
一些特别说明:凡是涉及到页面操作的接口,请保证在主线程中调用,SDK也保证在主线程中返回
22+
不涉及到页面操作的接口,SDK会开子线程去处理,不保证在子线程中返回。
23+
*/
24+
25+
26+
/*
27+
28+
*/
29+
30+
#import <Foundation/Foundation.h>
31+
#import <UIKit/UIKit.h>
32+
33+
34+
35+
36+
37+
38+
39+
40+
#pragma mark - 主模块功能。
41+
42+
NS_ASSUME_NONNULL_BEGIN
43+
44+
typedef NS_ENUM(NSInteger, AuthorizationLoginType)
45+
{
46+
LOGIN_TYPE_DEFAULT = 0, //默认为显示登录类型
47+
LOGIN_TYPE_IMPLICIT = 1 //隐式登录类型()
48+
};
49+
50+
typedef NS_ENUM(NSInteger, VerificationCodeType)
51+
{
52+
//一个账号,有可能设置了密保手机号,也绑定了手机号,也可能是绑定了邮箱,而且可以是不同的号码,这个时候,用验证验证码时,要确定是用的密保的手机,还是绑定的手机,还是绑定的邮箱
53+
54+
bandMobileType = 1, //绑定手机的验证码
55+
secretMobileType = 2, //密保手机的验证码
56+
emailType = 3 //
57+
};
58+
59+
/**
60+
声明一个block
61+
62+
@param resultDic 网络返回的data的解析结果
63+
64+
*/
65+
typedef void (^successHandler) ( NSDictionary * _Nonnull resultDic);
66+
/**
67+
声明一个block
68+
69+
@param error 网络返回的错误或者其它错误
70+
71+
*/
72+
typedef void (^failureHandler) (NSError * _Nonnull error);
73+
74+
@interface EAccount : NSObject
75+
76+
//@property (nonatomic) BOOL alwayShowLoginWAP;
77+
@property (nonatomic, weak) UIViewController * rootViewController;
78+
/*
79+
@description 获取当前设备的设备id
80+
81+
@return deviceId()
82+
*/
83+
@property (NS_NONATOMIC_IOSONLY, getter=getCurrentDeviceId, readonly, copy) NSString * _Nonnull currentDeviceId;
84+
85+
86+
//自营业务的初始化
87+
/**
88+
初始化SDK
89+
90+
@param appKey 接入方在账号平台领取的appKey
91+
@param appSecrect 接入方在账号平台领取的appSecrect
92+
@param appName 接入方在账号平台领取的appName
93+
*/
94+
+ (void)initWithSelfKey:(NSString *)appKey
95+
appSecret:(NSString *)appSecrect
96+
appName:(NSString *)appName;
97+
98+
99+
100+
/**
101+
获取授权码
102+
@param completion 成功回调
103+
@param fail 失败的回调
104+
@param bussinessType 业务类型
105+
*/
106+
+ (void)preGetMobileAccessCode:(NSString *)bussinessType completion:(successHandler)completion failure:(failureHandler)fail;
107+
108+
109+
+ (void)gatewayAuth:(BOOL)needComfirmCode veriyType:(BOOL)veriyType phone:(NSString*)phone success:(successHandler)completion failure:(failureHandler)fail;
110+
111+
112+
@end
113+
114+
NS_ASSUME_NONNULL_END
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
//
2+
// EAccountSDK.h
3+
// EAccountSDK
4+
//
5+
// Created by thy on 2017/4/8.
6+
// Copyright © 2017年 EAccount. All rights reserved.
7+
//
8+
9+
#import <UIKit/UIKit.h>
10+
11+
#import "EAccount.h"
12+
13+
//! Project version number for EAccountSDK.
14+
FOUNDATION_EXPORT double EAccountSDKVersionNumber;
15+
16+
//! Project version string for EAccountSDK.
17+
FOUNDATION_EXPORT const unsigned char EAccountSDKVersionString[];
18+
19+
// In this header, you should import all the public headers of your framework using statements like #import <EAccountSDK/PublicHeader.h>
20+
21+
722 Bytes
Binary file not shown.
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
framework module EAccountSDK {
2+
umbrella header "EAccountSDK.h"
3+
4+
export *
5+
module * { export * }
6+
}
Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
//
2+
// JVERIFICATIONService.h
3+
// JVerification
4+
//
5+
// Created by andy on 2018/9/11.
6+
// Copyright © 2018年 hxhg. All rights reserved.
7+
//
8+
9+
#import <Foundation/Foundation.h>
10+
11+
#define JVER_VERSION_NUMBER 1.0.1
12+
13+
@interface JVAuthConfig : NSObject
14+
15+
/* appKey 必须的,应用唯一的标识. */
16+
@property (nonatomic, copy) NSString *appKey;
17+
/* channel 发布渠道. 可选,默认为空*/
18+
@property (nonatomic, copy) NSString *channel;
19+
/* advertisingIdentifier 广告标识符(IDFA). 可选,默认为空*/
20+
@property (nonatomic, copy) NSString *advertisingId;
21+
/* isProduction 是否生产环境. 如果为开发状态,设置为NO;如果为生产状态,应改为YES.可选,默认为NO */
22+
@property (nonatomic, assign) BOOL isProduction;
23+
24+
@end
25+
26+
@interface JVAuthEntity : NSObject<NSCopying>
27+
28+
/* number 必须的,需要认证的手机号. */
29+
@property (nonatomic, copy) NSString *number;
30+
/* token 认证手机号码的授权码. 可选,默认为空,则自动获取后再认证*/
31+
@property (nonatomic, copy) NSString *token;
32+
33+
@end
34+
35+
@interface JVERIFICATIONService : NSObject
36+
37+
+ (void)setupWithConfig:(JVAuthConfig *)config;
38+
39+
/**
40+
获取手机号校验token
41+
42+
@param completion token相关信息。
43+
*/
44+
+ (void)getToken:(void (^)(NSDictionary *result))completion;
45+
46+
/**
47+
手机号校验
48+
49+
@param entity 认证配置信息
50+
@param completion 认证结果
51+
*/
52+
+ (void)verifyNumber:(JVAuthEntity *)entity result:(void (^)(NSDictionary *result))completion;
53+
54+
/*!
55+
* @abstract 设置是否打印sdk产生的Debug级log信息, 默认为NO(不打印log)
56+
*
57+
* SDK 默认开启的日志级别为: Info. 只显示必要的信息, 不打印调试日志.
58+
*
59+
* 请在SDK启动后调用本接口,调用本接口可打开日志级别为: Debug, 打印调试日志.
60+
* 请在发布产品时改为NO,避免产生不必要的IO
61+
*/
62+
+ (void)setDebug:(BOOL)enable;
63+
64+
@end
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
//
2+
// RCTJVerificationModule.h
3+
// RCTJVerificationModule
4+
//
5+
// Created by oshumini on 2018/11/5.
6+
// Copyright © 2018 HXHG. All rights reserved.
7+
//
8+
9+
#import <Foundation/Foundation.h>
10+
11+
@interface RCTJVerificationModule : NSObject
12+
13+
@end

0 commit comments

Comments
 (0)