From 7e06d0fb18152ea0e7d898d25c88ef132af3ec6e Mon Sep 17 00:00:00 2001 From: mac <user@users-MacBook-Pro.local> Date: 星期五, 29 三月 2024 15:26:19 +0800 Subject: [PATCH] 2024年03月29日15:26:15 --- app/src/main/java/com/hdl/photovoltaic/uni/HDLUniMPSDKManager.java | 26 ++++++++++++++++---------- 1 files changed, 16 insertions(+), 10 deletions(-) diff --git a/app/src/main/java/com/hdl/photovoltaic/uni/HDLUniMPSDKManager.java b/app/src/main/java/com/hdl/photovoltaic/uni/HDLUniMPSDKManager.java index 9af7076..6f5b2e7 100644 --- a/app/src/main/java/com/hdl/photovoltaic/uni/HDLUniMPSDKManager.java +++ b/app/src/main/java/com/hdl/photovoltaic/uni/HDLUniMPSDKManager.java @@ -92,12 +92,14 @@ private void removeCallBack() { DCUniMPSDK.getInstance().setUniMPOnCloseCallBack(null); DCUniMPSDK.getInstance().setOnUniMPEventCallBack(null); + } /** * 鐩戝惉鐩稿叧鍥炶皟 */ private void registerCallBack() { + DCUniMPSDK.getInstance(); //1.璁剧疆灏忕▼搴忚鍏抽棴浜嬩欢鐩戝惉 DCUniMPSDK.getInstance().setUniMPOnCloseCallBack(new IUniMPOnCloseCallBack() { @Override @@ -114,10 +116,10 @@ mCurrentAppId = ""; } -// //灏忕▼搴忚鍏抽棴浜嗛�氱煡缁欏師鐢� -// BaseEventBus baseEventBus = new BaseEventBus(); -// baseEventBus.setType(HDLUniMP.UNI_EVENT_REPLY_HOME_CLOSE_HOME_DETAILS_PAGE); -// EventBus.getDefault().post(baseEventBus); + //灏忕▼搴忚鍏抽棴浜嗛�氱煡缁欏師鐢� + BaseEventBus baseEventBus = new BaseEventBus(); + baseEventBus.setType(HDLUniMP.UNI_EVENT_REPLY_HOME_CLOSE_HOME_DETAILS_PAGE); + EventBus.getDefault().post(baseEventBus); } }); @@ -130,6 +132,8 @@ HdlLogLogic.print("鏀跺埌灏忕▼搴忛�氱煡 event=" + event); //鏆傛椂閫氳繃杩欎釜澶勭悊灏忕▼搴忓悓鏃跺鏉$浉鍚岀殑璇锋眰 if (data == null) { + HdlLogLogic.print("鏀跺埌灏忕▼搴忛�氱煡,data鏁版嵁涓簄ull銆�", true); + return; } // String key= MD5Utils.getMd5(event+data.toString()); @@ -150,6 +154,8 @@ //闄や簡缁熶竴澶勭悊锛屽墿浣欏叾瀹冪壒瀹氬満鏅殑浜嬩欢閫氱煡 if (onOtherUniMPEventCallBack != null) { onOtherUniMPEventCallBack.onOtherUniMPEventReceive(appid, event, data, callback); + } else { + HdlLogLogic.print("鏀跺埌灏忕▼搴忛�氱煡,鍥炶皟浜嬩欢涓簄ull,鏃犳硶鍥炶皟浜嬩欢骞舵墽琛屼笟鍔¢�昏緫--->event=" + event + "\r\n" + "data=" + data, true); } } } @@ -344,20 +350,20 @@ * 娉ㄦ剰锛氶渶瑕佹彁鍓嶅皬绋嬪簭鍦ㄨ繍琛屾墠鍙垚鍔� * * @param uniAppId 灏忕▼搴忔寚瀹� - * @param event 灏忕▼搴忔寚瀹氫富棰� + * @param topic 灏忕▼搴忔寚瀹氫富棰� * @param data String鎴朖SON */ - public void sendUniMPEvent(String uniAppId, String event, Object data) { + public void sendUniMPEvent(String uniAppId, String topic, Object data) { if (mUniMPCaches.containsKey(uniAppId)) { if (mUniMPCaches.get(uniAppId) != null) { - mUniMPCaches.get(uniAppId).sendUniMPEvent(event, data); - HdlLogLogic.print("鍙戦�侀�氱煡鎴愬姛锛歟vent锛�" + event + " data锛�" + new Gson().toJson(data)); + mUniMPCaches.get(uniAppId).sendUniMPEvent(topic, data); + HdlLogLogic.print("Android--->閫氱煡---uni--->涓婚:" + topic + "--->鍙戦�佹暟鎹�:" + new Gson().toJson(data)); } else { - HdlLogLogic.print("鍙戦�佸け璐ワ紝灏忕▼搴忓璞′负绌猴細" + uniAppId); + HdlLogLogic.print("Android--->閫氱煡---uni--->澶辫触--->灏忕▼搴忓璞′负绌�:" + uniAppId); } } else { - HdlLogLogic.print("鍙戦�佸け璐ワ紝鎵句笉鍒板搴旂殑灏忕▼搴忥細" + uniAppId); + HdlLogLogic.print("Android--->閫氱煡---uni--->澶辫触--->灏忕▼搴忓璞′负绌�:" + uniAppId); } } -- Gitblit v1.8.0