update:更新tysdk 默认修改

This commit is contained in:
2026-05-14 11:53:38 +08:00
parent 49d80ee008
commit eecf54c6a4
6 changed files with 199 additions and 71 deletions

View File

@@ -126,12 +126,26 @@ public class SDKManager {
TYUnityActivity.setSdkInited();
SDKAPI.getIns().onActivityStart(activity);
SDKAPI.getIns().onActivityResume(activity);
notifyInitResult(true, "ok");
} catch (Exception e) {
System.out.println("initSDK Exception " + e);
notifyInitResult(false, e.getMessage());
}
});
}
static void notifyInitResult(boolean success, String msg) {
try {
JSONObject result = new JSONObject();
result.put("code", success ? 0 : 1);
result.put("msg", msg);
UnityPlayer.UnitySendMessage(ConfigManager.UNITY_FACADE_NAME,
ConfigManager.INIT_CALLBACK_FUNCTION_NAME, result.toString());
} catch (JSONException e) {
Log.e(TAG, "notifyInitResult error: " + e);
}
}
// -------------------------------------------------------------------------
// Login / Callbacks (shared)
// -------------------------------------------------------------------------