Skip to content
This repository was archived by the owner on Aug 14, 2019. It is now read-only.

Commit 283b2a2

Browse files
authored
Merge pull request #1090 from rzmj0907/master
JVerification Android && iOS SDK updated.
2 parents 061f061 + 1704875 commit 283b2a2

File tree

2 files changed

+77
-8
lines changed

2 files changed

+77
-8
lines changed

zh/jverification/client/android_api.md

Lines changed: 51 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -242,6 +242,50 @@
242242

243243
##SDK请求授权一键登录(新)
244244

245+
### 支持的版本
246+
开始支持的版本 2.4.0
247+
248+
### 接口的定义
249+
+ ***JVerificationInterface.loginAuth(final Context context, boolean autoFinish, final VerifyListener listener, final AuthPageEventListener authPageEventListener)***
250+
+ 接口说明:
251+
+ 调起一键登录授权页面,在用户授权后获取loginToken,同时支持授权页事件监听
252+
+ 参数说明:
253+
+ context:android的上下文
254+
+ boolean:是否自动关闭授权页,true - 是,false - 否
255+
+ listener:登录授权结果回调
256+
+ authPageEventListener:授权页事件回调
257+
+ 回调说明:
258+
+ VerifyListener
259+
***onResult(int code, String content, String operator)***
260+
+ code: 返回码,6000代表loginToken获取成功,6001代表loginToken获取失败,其他返回码详见描述
261+
+ content:返回码的解释信息,若获取成功,内容信息代表loginToken。
262+
+ operator:成功时为对应运营商,CM代表中国移动,CU代表中国联通,CT代表中国电信。失败时可能为null
263+
+ AuthPageEventListener
264+
***onEvent(int code, String content)***
265+
+ cmd: 返回码,1代表授权页关闭事件。
266+
+ content:内容描述。
267+
+ 调用示例:
268+
269+
~~~
270+
JVerificationInterface.loginAuth(this, false, new VerifyListener() {
271+
@Override
272+
public void onResult(int code, String content, String operator) {
273+
if (code == 6000){
274+
Log.d(TAG, "code=" + code + ", token=" + content+" ,operator="+operator);
275+
}else{
276+
Log.d(TAG, "code=" + code + ", message=" + content);
277+
}
278+
}
279+
},new AuthPageEventListener() {
280+
@Override
281+
public void onEvent(int cmd, String msg) {
282+
Log.d(TAG, "[onEvent]. [" + cmd + "]message=" + msg);
283+
}
284+
});
285+
~~~
286+
287+
##SDK请求授权一键登录(旧)
288+
245289
### 支持的版本
246290
开始支持的版本 2.3.0
247291

@@ -430,15 +474,14 @@
430474
+ ***addNavControlView(View view, JVerifyUIClickCallback callback)***
431475

432476
+ 接口说明:
433-
+ 在授权页中顶部导航栏添加自定义控件
477+
+ 在授权页中顶部导航栏添加自定义控件
434478
+ 参数说明:
435-
+ view:开发者传入自定义的控件,开发者需要提前设置好控件的布局属性,SDK只支持RelativeLayout布局
436-
+ callback: 自定义控件的点击回调
437-
+ 回调说明:
438-
+ ***onClicked(Context context, View view)***
439-
+ context:android的上下文
440-
+ view:自定义的控件的对象
441-
479+
+ view:开发者传入自定义的控件,开发者需要提前设置好控件的布局属性,SDK只支持RelativeLayout布局
480+
+ callback: 自定义控件的点击回调
481+
+ 回调说明:
482+
+ ***onClicked(Context context, View view)***
483+
+ context:android的上下文
484+
+ view:自定义的控件的对象
442485
+ 调用示例:
443486

444487
~~~

zh/jverification/client/ios_api.md

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -227,6 +227,32 @@ if (isSetupClient) {
227227

228228
##SDK请求授权一键登录(新)
229229

230+
###支持的版本
231+
开始支持的版本 2.4.0
232+
233+
+ ***+ (void)getAuthorizationWithController:(UIViewController \*)vc hide:(BOOL)hide completion:(void (^)(NSDictionary \*result))completion actionBlock:(void(^)(NSInteger type, NSString \*content))actionBlock***
234+
235+
+ 接口说明:
236+
+ 授权登录
237+
+ 参数说明:
238+
+ completion 登录结果
239+
+ result 字典 获取到token时key有operator、code、loginToken字段,获取不到token是key为code和content字段
240+
+ vc 当前控制器
241+
+ hide 完成后是否自动隐藏授权页。
242+
+ actionBlock 授权页事件触发回调。包含type和content两个参数,type为事件类型,content为事件描述。 type = 1,授权页被关闭
243+
244+
+ 调用示例:
245+
246+
~~~
247+
[JVERIFICATIONService getAuthorizationWithController:self hide:YES completion:^(NSDictionary *result) {
248+
NSLog(@"一键登录 result:%@", result);
249+
} actionBlock:^(NSInteger type, NSString *content) {
250+
NSLog(@"一键登录 actionBlock :%ld %@", (long)type , content);
251+
}];
252+
~~~
253+
254+
##SDK请求授权一键登录(旧)
255+
230256
###支持的版本
231257
开始支持的版本 2.3.0
232258

0 commit comments

Comments
 (0)