mac
2024-03-14 969a251801a4553920b799ba9be0fcb9e69e47ed
app/src/main/java/com/hdl/photovoltaic/uni/HDLUniMPSDKManager.java
@@ -92,12 +92,13 @@
    private void removeCallBack() {
        DCUniMPSDK.getInstance().setUniMPOnCloseCallBack(null);
        DCUniMPSDK.getInstance().setOnUniMPEventCallBack(null);
    }
    /**
     * 监听相关回调
     */
    private void registerCallBack() {
    private void registerCallBack() {DCUniMPSDK.getInstance();
        //1.设置小程序被关闭事件监听
        DCUniMPSDK.getInstance().setUniMPOnCloseCallBack(new IUniMPOnCloseCallBack() {
            @Override
@@ -114,10 +115,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);
            }
        });
@@ -344,15 +345,15 @@
     * 注意:需要提前小程序在运行才可成功
     *
     * @param uniAppId 小程序指定
     * @param event    小程序指定主题
     * @param topic    小程序指定主题
     * @param data     String或JSON
     */
    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("发送通知成功:event:" + event + " data:" + new Gson().toJson(data));
                mUniMPCaches.get(uniAppId).sendUniMPEvent(topic, data);
                HdlLogLogic.print("发送通知成功:event:" + topic + " data:" + new Gson().toJson(data));
            } else {
                HdlLogLogic.print("发送失败,小程序对象为空:" + uniAppId);
            }