提交 bdcb3377 作者: 刘添

--no commit message

上级 384f8bf6
## GameSDKV1.0文档接入使用
## GameSDKV1.0文档接入使用 ## GameSDKV1.0文档接入使用
[目录](#sec1) [目录](#sec1)
...@@ -42,12 +43,11 @@ ...@@ -42,12 +43,11 @@
### 3、导入配置SDK资源Androidstudio项目<a name="sec3"></a> ### 3、导入配置SDK资源Androidstudio项目<a name="sec3"></a>
- 将GameSDK-xxx.aar文件复制到libs文件下 - 将GameSDK-xxx.aar文件复制到libs文件下
![libs](https://zhangsheng-1300623068.cos.ap-guangzhou.myqcloud.com/default%2F1.png) ![image.png](https://upload-images.jianshu.io/upload_images/6624077-1377c60a9358ca2b.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240)
- 在主工程build.gradle配置,如下图所示: - 在主工程build.gradle配置,如下图所示:
![image.png](https://zhangsheng-1300623068.cos.ap-guangzhou.myqcloud.com/default%2F2.png) ![image.png](https://upload-images.jianshu.io/upload_images/6624077-e04f6ff77f568a03.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240)
### 4、配置清单文件(具体请参考demo)<a name="sec4"></a> ### 4、配置清单文件(具体请参考demo)<a name="sec4"></a>
...@@ -96,20 +96,15 @@ ...@@ -96,20 +96,15 @@
GameSdk.getInstance().init(this); GameSdk.getInstance().init(this);
} }
``` ```
### 6、登录<a name="sec6"></a> ### 6、登录<a name="sec6"></a>
1、添加登录回调监听 1、添加登录回调监听
``` ```
public void addLoginListener(OnLoginListener onLoginListener) public void addLoginListener(OnLoginListener onLoginListener)
``` ```
- 说明:在登陆前必须注册登陆回调监听,用于接收登陆结果,登录成功返回token - 说明:在登陆前必须注册登陆回调监听,用于接收登陆结果,登录成功返回token
| 参数 | 说明 | | 参数 | 说明|
| :-------- | -------------: | | :-------- | -------------: |
| OnLoginListener | 登录回调接口 | | OnLoginListener | 登录回调接口 |
...@@ -182,11 +177,12 @@ void loginError(Object data); ...@@ -182,11 +177,12 @@ void loginError(Object data);
``` ```
### 7、调起支付页面<a name="sec7"></a>
1、调起支付页面方法
### 7、调起支付页面<a name="sec7"></a>
1、调起支付页面方法
``` ```
public void showPay(CustomPayParam payParam, OnPaymentListener paymentListener) public void showPay(CustomPayParam payParam, OnPaymentListener paymentListener)
...@@ -199,7 +195,9 @@ public void showPay(CustomPayParam payParam, OnPaymentListener paymentListener) ...@@ -199,7 +195,9 @@ public void showPay(CustomPayParam payParam, OnPaymentListener paymentListener)
|payParam|支付参数| |payParam|支付参数|
|paymentListener|回调接口| |paymentListener|回调接口|
- 调用示例
> **调用示例**:
``` ```
CustomPayParam data=new CustomPayParam(); CustomPayParam data=new CustomPayParam();
...@@ -238,10 +236,9 @@ public void showPay(CustomPayParam payParam, OnPaymentListener paymentListener) ...@@ -238,10 +236,9 @@ public void showPay(CustomPayParam payParam, OnPaymentListener paymentListener)
}); });
``` ```
##### 下单支付字段说明
> **参数说明**: > **下单支付字段说明**:
| 名称|类型 | 是否必须| 默认值 | 备注| | 名称|类型 | 是否必须| 默认值 | 备注|
...@@ -299,9 +296,9 @@ public void showPay(CustomPayParam payParam, OnPaymentListener paymentListener) ...@@ -299,9 +296,9 @@ public void showPay(CustomPayParam payParam, OnPaymentListener paymentListener)
} }
}); });
``` ```
##### 角色上报字段说明
> **参数说明**:
> **角色上报字段说明**:
| 名称 | 类型 | 是否必须| 默认值 | 备注| | 名称 | 类型 | 是否必须| 默认值 | 备注|
|:--------| -------------:| -------------------:|-------------:|-------------:| |:--------| -------------:| -------------------:|-------------:|-------------:|
...@@ -324,7 +321,9 @@ public void showPay(CustomPayParam payParam, OnPaymentListener paymentListener) ...@@ -324,7 +321,9 @@ public void showPay(CustomPayParam payParam, OnPaymentListener paymentListener)
``` ```
public void addLogoutListener(OnLogoutListener onLogoutListener) public void addLogoutListener(OnLogoutListener onLogoutListener)
``` ```
1、在退出登陆前必须注册退出登陆回调监听,用于接收退出登陆,或者登陆过期的退出登陆结果。 1、在退出登陆前必须注册退出登陆回调监听,用于接收退出登陆,或者登陆过期的退出登陆结果。
2、 参数类说明:OnLogoutListener需要实现两个方法: 2、 参数类说明:OnLogoutListener需要实现两个方法:
...@@ -339,7 +338,6 @@ public void addLogoutListener(OnLogoutListener onLogoutListener) ...@@ -339,7 +338,6 @@ public void addLogoutListener(OnLogoutListener onLogoutListener)
| :-------- | ----: | | :-------- | ----: |
| OnLogoutListener | 退出登陆回调接口 | | OnLogoutListener | 退出登陆回调接口 |
> **退出登录成功**: > **退出登录成功**:
``` ```
...@@ -354,8 +352,7 @@ public void logoutError(String msg); ...@@ -354,8 +352,7 @@ public void logoutError(String msg);
``` ```
> **调用示例**: > **调用示例**:
>
``` ```
GameSdk.getInstance().addLogoutListener(new OnLogoutListener() { GameSdk.getInstance().addLogoutListener(new OnLogoutListener() {
...@@ -370,16 +367,13 @@ public void logoutError(String msg); ...@@ -370,16 +367,13 @@ public void logoutError(String msg);
} }
}); });
``` ```
- 说明:在需要退出登陆时可调用此方法,注意此方法为退出,并不会调出登陆界面 - 说明:在需要退出登陆时可调用此方法,注意此方法为退出,并不会调出登陆界面
### 10、退出应用弹框<a name="sec10"></a> ### 10、退出应用弹框<a name="sec10"></a>
1、添加退出回调监听 1、添加退出回调监听
> **调用示例**: > **调用示例**:
``` ```
public void exitApp(ExitAppListener listener) public void exitApp(ExitAppListener listener)
``` ```
...@@ -392,7 +386,6 @@ public void exitApp(ExitAppListener listener) ...@@ -392,7 +386,6 @@ public void exitApp(ExitAppListener listener)
| ExitAppListener | 退出应用回调接口 | | ExitAppListener | 退出应用回调接口 |
> **调用示例**: > **调用示例**:
``` ```
@Override @Override
public void onBackPressed() { public void onBackPressed() {
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论