From b93ca15aa55af7cf2dee653beb100076c897f152 Mon Sep 17 00:00:00 2001 From: mac <user@users-MacBook-Pro.local> Date: 星期二, 25 六月 2024 16:56:38 +0800 Subject: [PATCH] 2024年06月25日16:56:31 --- app/src/main/java/com/hdl/photovoltaic/uni/HDLUniMPSDKManager.java | 30 ++++++++++++++++-------------- 1 files changed, 16 insertions(+), 14 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 8558485..d36418e 100644 --- a/app/src/main/java/com/hdl/photovoltaic/uni/HDLUniMPSDKManager.java +++ b/app/src/main/java/com/hdl/photovoltaic/uni/HDLUniMPSDKManager.java @@ -3,6 +3,7 @@ import android.app.Application; import android.content.Context; import android.os.Environment; +import android.os.SystemClock; import android.text.TextUtils; @@ -10,6 +11,7 @@ import com.hdl.photovoltaic.HDLApp; import com.hdl.photovoltaic.R; import com.hdl.photovoltaic.config.AppConfigManage; +import com.hdl.photovoltaic.enums.LowerTagType; import com.hdl.photovoltaic.other.HdlLogLogic; import com.hdl.photovoltaic.other.HdlThreadLogic; import com.hdl.sdk.link.core.bean.eventbus.BaseEventBus; @@ -118,7 +120,8 @@ //灏忕▼搴忚鍏抽棴浜嗛�氱煡缁欏師鐢� BaseEventBus baseEventBus = new BaseEventBus(); - baseEventBus.setType(HDLUniMP.UNI_EVENT_REPLY_HOME_CLOSE_HOME_DETAILS_PAGE); + baseEventBus.setTopic(HDLUniMP.UNI_EVENT_REPLY_HOME_CLOSE_HOME_DETAILS_PAGE); + baseEventBus.setType(LowerTagType.power_station.toString()); EventBus.getDefault().post(baseEventBus); } @@ -255,15 +258,6 @@ return true; } - /** - * 鎵撳紑灏忕▼搴� - * - * @param uniAppId 灏忕▼搴廔D - * @param path 鎸囧畾璺緞 - * 渚嬶細pages/component/scroll-view/scroll-view?a=1&b=2&c=3 - * @param jsonObject 闄勫姞鏁版嵁 - * @param callBack 鐩戝惉灏忕▼搴廜therUniMPEvent浜嬩欢 - */ public void openUniMP(String uniAppId, String path, JSONObject jsonObject, IOnOtherUniMPEventCallBack callBack) { if (TextUtils.isEmpty(uniAppId)) { HdlThreadLogic.toast(mContext, "uni Id null"); @@ -279,14 +273,22 @@ UniMPOpenConfiguration uniMPOpenConfiguration = new UniMPOpenConfiguration(); uniMPOpenConfiguration.path = path; uniMPOpenConfiguration.extraData = jsonObject; + uniMPOpenConfiguration.splashClass=MySplashView.class; uniMP = DCUniMPSDK.getInstance().openUniMP(mContext, uniAppId, uniMPOpenConfiguration); + } + //android14鏈変簺璁惧鏈夐棶棰橈紝闇�瑕佺瓑寰� + if (android.os.Build.VERSION.SDK_INT >= 34) { + if (TextUtils.isEmpty(mCurrentAppId)) { + //绗竴娆$敤瑕佷紤鐪� + SystemClock.sleep(1000); + } } mCurrentAppId = uniAppId;//璁板綍褰撳墠灏忕▼搴� mUniMPCaches.put(uniMP.getAppid(), uniMP); } catch (Exception e) { e.printStackTrace(); HdlThreadLogic.toast(HDLApp.getInstance(), R.string.uni_open_error); - initDCUniMPSDK(HDLApp.getInstance()); +// initDCUniMPSDK(HDLApp.getInstance()); HdlLogLogic.print("鎵撳紑澶辫触===" + e.getMessage()); } } @@ -358,12 +360,12 @@ if (mUniMPCaches.containsKey(uniAppId)) { if (mUniMPCaches.get(uniAppId) != null) { mUniMPCaches.get(uniAppId).sendUniMPEvent(topic, data); - HdlLogLogic.print("鍙戦�侀�氱煡鎴愬姛锛歟vent锛�" + topic + " data锛�" + new Gson().toJson(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