提交 1286dbad 作者: 钱宇

modify:聚合SDK文档修改。

上级 0aaa5fe4
plugins { plugins {
...@@ -79,5 +79,5 @@ dependencies { ...@@ -79,5 +79,5 @@ dependencies {
androidTestImplementation(libs.androidx.junit) androidTestImplementation(libs.androidx.junit)
androidTestImplementation(libs.androidx.espresso.core) androidTestImplementation(libs.androidx.espresso.core)
implementation("com.zw.game.center:gameCenter:1.0.0.4") implementation("com.zw.game.center:gameCenter:1.0.0.3")
} }
\ No newline at end of file
package com.zwgame.test.gamecenterdemo package com.zwgame.test.gamecenterdemo
...@@ -59,7 +59,8 @@ class MainActivity : AppCompatActivity() { ...@@ -59,7 +59,8 @@ class MainActivity : AppCompatActivity() {
val obj = JSONObject(result) val obj = JSONObject(result)
val success = obj.optBoolean("success") val success = obj.optBoolean("success")
if (success) { if (success) {
Log.i(TAG, "init 成功") val channelCode = obj.optString("channelCode")
Log.i(TAG, "init 成功,当前渠道:$channelCode")
} else { } else {
Log.w(TAG, "init 失败 errorMsg=${obj.optString("errorMsg")} errorCode=${obj.optInt("errorCode")}") Log.w(TAG, "init 失败 errorMsg=${obj.optString("errorMsg")} errorCode=${obj.optInt("errorCode")}")
} }
...@@ -173,12 +174,12 @@ class MainActivity : AppCompatActivity() { ...@@ -173,12 +174,12 @@ class MainActivity : AppCompatActivity() {
private fun onShowFloatClick() { private fun onShowFloatClick() {
statusText.setText(R.string.status_show_float_clicked) statusText.setText(R.string.status_show_float_clicked)
ZySdk.sdkShowFloat(this) { } ZySdk.showHuaweiFloat(this) { }
} }
private fun onHideFloatClick() { private fun onHideFloatClick() {
statusText.setText(R.string.status_hide_float_clicked) statusText.setText(R.string.status_hide_float_clicked)
ZySdk.sdkHideFloat(this) { } ZySdk.hideHuaweiFloat(this) { }
} }
private fun onExitClick() = guardBusy { private fun onExitClick() = guardBusy {
......
package com.zwgame.test.gamecenterdemo; package com.zwgame.test.gamecenterdemo;
...@@ -68,7 +68,8 @@ public class MainJavaActivity extends AppCompatActivity { ...@@ -68,7 +68,8 @@ public class MainJavaActivity extends AppCompatActivity {
JSONObject obj = new JSONObject(result); JSONObject obj = new JSONObject(result);
boolean success = obj.optBoolean("success"); boolean success = obj.optBoolean("success");
if (success) { if (success) {
Log.i(TAG, "init 成功"); String channelCode = obj.optString("channelCode");
Log.i(TAG, "init 成功,当前渠道:" + channelCode);
} else { } else {
Log.w(TAG, "init 失败 errorMsg=" + obj.optString("errorMsg") + " errorCode=" + obj.optInt("errorCode")); Log.w(TAG, "init 失败 errorMsg=" + obj.optString("errorMsg") + " errorCode=" + obj.optInt("errorCode"));
} }
...@@ -217,12 +218,12 @@ public class MainJavaActivity extends AppCompatActivity { ...@@ -217,12 +218,12 @@ public class MainJavaActivity extends AppCompatActivity {
private void onShowFloatClick() { private void onShowFloatClick() {
statusText.setText(R.string.status_show_float_clicked); statusText.setText(R.string.status_show_float_clicked);
ZySdk.INSTANCE.sdkShowFloat(this, (Function1<String, Unit>) result -> Unit.INSTANCE); ZySdk.INSTANCE.showHuaweiFloat(this, (Function1<String, Unit>) result -> Unit.INSTANCE);
} }
private void onHideFloatClick() { private void onHideFloatClick() {
statusText.setText(R.string.status_hide_float_clicked); statusText.setText(R.string.status_hide_float_clicked);
ZySdk.INSTANCE.sdkHideFloat(this, (Function1<String, Unit>) result -> Unit.INSTANCE); ZySdk.INSTANCE.hideHuaweiFloat(this, (Function1<String, Unit>) result -> Unit.INSTANCE);
} }
private void onExitClick() { private void onExitClick() {
......
# Game Center SDK 接入说明V1.0.0.0 # Game Center SDK 接入说明V1.0.0.0
...@@ -185,7 +185,8 @@ ZySdk.sdkInit(activity) { result -> ...@@ -185,7 +185,8 @@ ZySdk.sdkInit(activity) { result ->
val obj = JSONObject(result) val obj = JSONObject(result)
val success = obj.optBoolean("success") val success = obj.optBoolean("success")
if (success) { if (success) {
Log.i(TAG, "init 成功") val channelCode = obj.optString("channelCode")
Log.i(TAG, "init 成功,当前渠道:$channelCode")
} else { } else {
val errorMsg = obj.optString("errorMsg") val errorMsg = obj.optString("errorMsg")
val errorCode = obj.optInt("errorCode") val errorCode = obj.optInt("errorCode")
...@@ -204,10 +205,12 @@ ZySdk.sdkInit(activity) { result -> ...@@ -204,10 +205,12 @@ ZySdk.sdkInit(activity) { result ->
**回参** **回参**
| 字段 | 类型 | 含义 | | 字段 | 类型 | 含义 |
|:-----------:|:-------:|:--------:| |:-------------:|:-------:|:------------------------------------:|
| `success` | Boolean | 是否成功 | | `success` | Boolean | 是否成功 |
| `errorMsg` | String | 失败时的提示文案 | | `errorMsg` | String | 失败时的提示文案 |
| `errorCode` | Int | 错误码 | | `errorCode` | Int | 错误码 |
| `msg` | String | 提示文案 |
| `channelCode` | String | 渠道编码(oppo、vivo、xiaomi、huawei、honor等) |
**华为渠道错误码如下:** **华为渠道错误码如下:**
...@@ -538,13 +541,13 @@ ZySdk.sdkUpdate(this) { result -> ...@@ -538,13 +541,13 @@ ZySdk.sdkUpdate(this) { result ->
显示浮窗 显示浮窗
```kotlin ```kotlin
ZySdk.sdkShowFloat(this) { result -> ZySdk.showHuaweiFloat(this) { result ->
} }
``` ```
隐藏浮窗 隐藏浮窗
```kotlin ```kotlin
ZySdk.sdkHideFloat(this) { result -> ZySdk.hideHuaweiFloat(this) { result ->
} }
``` ```
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论