From 49d08345263fb1ce1b0aaf394a81ad79967b8d78 Mon Sep 17 00:00:00 2001
From: allez <305670599@qq.com>
Date: 星期二, 09 二月 2021 11:02:36 +0800
Subject: [PATCH] 0312 BTZF SDK 支持双平台互通

---
 SdkProject/app/src/main/java/com/secondworld/demo/MainActivity.java |   29 ++++++++++++++++++++++++++---
 1 files changed, 26 insertions(+), 3 deletions(-)

diff --git a/SdkProject/app/src/main/java/com/secondworld/demo/MainActivity.java b/SdkProject/app/src/main/java/com/secondworld/demo/MainActivity.java
index 59a7fb1..c0fc998 100644
--- a/SdkProject/app/src/main/java/com/secondworld/demo/MainActivity.java
+++ b/SdkProject/app/src/main/java/com/secondworld/demo/MainActivity.java
@@ -5,7 +5,6 @@
 import android.support.annotation.NonNull;
 import android.widget.RelativeLayout;
 
-import com.secondworld.sdk.GTGameApp;
 import com.secondworld.sdk.GameActivityProxy;
 import com.secondworld.sdk.UnityMsgHandler;
 import com.secondworld.sdk.utils.CodeU2A;
@@ -50,8 +49,7 @@
         {
             JSONObject json = new JSONObject();
             try {
-                json.put("code", CodeU2A.OpenWebView);
-                json.put("url", "http://sydownload.secondworld.net.cn/xmzc/notice/noticeweb/notice_bt.html");
+                json.put("code", CodeU2A.PlatformLogin);
             } catch (JSONException e) {
                 e.printStackTrace();
             }
@@ -73,6 +71,31 @@
             }
             UnityMsgHandler.onUnityMessage(json.toString());
         }));
+
+        findViewById(R.id.btnA).setOnClickListener(v -> {
+            JSONObject json = new JSONObject();
+            try {
+                json.put("code", CodeU2A.RequestPermission);
+                json.put("permission", "android.permission.RECORD_AUDIO");
+            } catch (JSONException e) {
+                e.printStackTrace();
+            }
+            UnityMsgHandler.onUnityMessage(json.toString());
+        });
+
+        findViewById(R.id.btnB).setOnClickListener(v -> {
+            unityMessage(CodeU2A.ShareToFaceBook);
+        });
+    }
+
+    private void unityMessage(int code) {
+        JSONObject json = new JSONObject();
+        try {
+            json.put("code", code);
+        } catch (JSONException e) {
+            e.printStackTrace();
+        }
+        UnityMsgHandler.onUnityMessage(json.toString());
     }
 
     @Override

--
Gitblit v1.8.0