From 30859ca8f2175475d2c666353bc27f3b2ceede53 Mon Sep 17 00:00:00 2001 From: mac <user@users-MacBook-Pro.local> Date: 星期四, 22 八月 2024 13:43:47 +0800 Subject: [PATCH] 2024年08月22日13:43:45 --- app/src/main/java/com/hdl/photovoltaic/uni/HDLUniMPSDKManager.java | 59 +++++++++++++---------------------------------------------- 1 files changed, 13 insertions(+), 46 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 b638066..61e066b 100644 --- a/app/src/main/java/com/hdl/photovoltaic/uni/HDLUniMPSDKManager.java +++ b/app/src/main/java/com/hdl/photovoltaic/uni/HDLUniMPSDKManager.java @@ -8,6 +8,7 @@ import com.google.gson.Gson; +import com.hdl.linkpm.sdk.user.HDLLinkPMUser; import com.hdl.photovoltaic.HDLApp; import com.hdl.photovoltaic.R; import com.hdl.photovoltaic.config.AppConfigManage; @@ -155,10 +156,13 @@ HdlLogLogic.print("uni_GetAppParams callback:" + params.toString()); } else { //闄や簡缁熶竴澶勭悊锛屽墿浣欏叾瀹冪壒瀹氬満鏅殑浜嬩欢閫氱煡 - if (onOtherUniMPEventCallBack != null) { + if (onOtherUniMPEventCallBack!= null) { onOtherUniMPEventCallBack.onOtherUniMPEventReceive(appid, event, data, callback); } else { HdlLogLogic.print("鏀跺埌灏忕▼搴忛�氱煡,鍥炶皟浜嬩欢涓簄ull,鏃犳硶鍥炶皟浜嬩欢骞舵墽琛屼笟鍔¢�昏緫--->event=" + event + "\r\n" + "data=" + data, true); + //鏈夊彲鑳芥槸绯荤粺鍥炴敹鎺塧ctivity瀵艰嚧鍥炶皟涓簄ull锛岃繖鏍锋儏鍐典笅寮哄埗杩斿洖鐧诲綍鐣岄潰锛� + //todo 闀挎椂闂存病鍝嶅簲灏嗛��鍑虹櫥褰曠晫闈㈤噸鏂扮櫥褰� + HDLLinkPMUser.getInstance().logout(0); } } } @@ -258,50 +262,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 openUniMPDelay(String uniAppId, String path, JSONObject jsonObject, IOnOtherUniMPEventCallBack callBack) { - if (TextUtils.isEmpty(uniAppId)) { - HdlThreadLogic.toast(mContext, "uni Id null"); - HdlLogLogic.print("灏忕▼搴廔D 涓嶈兘涓虹┖"); - return; - } - try { - setOnOtherUniMPEventCallBack(callBack); - uniMP = null; - if (TextUtils.isEmpty(path)) { - uniMP = DCUniMPSDK.getInstance().openUniMP(mContext, uniAppId); - } else { - 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()); - HdlLogLogic.print("鎵撳紑澶辫触===" + e.getMessage()); - } - } - public void openUniMP(String uniAppId, String path, JSONObject jsonObject, IOnOtherUniMPEventCallBack callBack) { if (TextUtils.isEmpty(uniAppId)) { HdlThreadLogic.toast(mContext, "uni Id null"); @@ -317,9 +277,16 @@ UniMPOpenConfiguration uniMPOpenConfiguration = new UniMPOpenConfiguration(); uniMPOpenConfiguration.path = path; uniMPOpenConfiguration.extraData = jsonObject; - uniMPOpenConfiguration.splashClass=MySplashView.class; + 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) { -- Gitblit v1.8.0