mac
2024-03-14 90374cac911932ac9cb9f832cf80476166e2e6df
app/src/main/java/com/hdl/photovoltaic/other/HdlJpushLogic.java
@@ -6,8 +6,10 @@
import com.google.gson.Gson;
import com.hdl.photovoltaic.config.ConstantManage;
import com.hdl.photovoltaic.config.UserConfigManage;
import com.hdl.photovoltaic.enums.MessageStateType;
import com.hdl.photovoltaic.jpush.JPushMessageInfoBean;
import com.hdl.photovoltaic.ui.CPowerStationActivity;
import com.hdl.photovoltaic.ui.MyPowerStationActivity;
import com.hdl.photovoltaic.ui.bean.MessageBean;
import com.hdl.sdk.link.core.bean.eventbus.BaseEventBus;
@@ -46,18 +48,22 @@
     * @param isOpened             true=点击通知栏回调,false=收到推送通知回调;
     */
    public void JpushPushCommonData(Context context, JPushMessageInfoBean jPushMessageInfoBean, boolean isOpened) {
        //添加推送数据到缓存列表中;
        this.addPushDataToMemoryList(jPushMessageInfoBean);
        if (isOpened) {
            Intent intent = new Intent(context, MyPowerStationActivity.class);
            intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_CLEAR_TOP);
            intent.putExtra("skip", "skip");//里面判断有这个标识就跳转到消息中心界面
            context.startActivity(intent);
        } else {
            BaseEventBus bus = new BaseEventBus();
            bus.setTopic(ConstantManage.message_function_push_post);
            bus.setType(MessageStateType.untreated);
            EventBus.getDefault().post(bus);
        if (UserConfigManage.getInstance().isBAccount()) {
            //添加推送数据到缓存列表中;
            this.addPushDataToMemoryList(jPushMessageInfoBean);
            if (isOpened) {
                //安装商跳转界面
                Intent intent = new Intent(context, MyPowerStationActivity.class);
                intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_CLEAR_TOP);
                intent.putExtra("skip", "skip");//里面判断有这个标识就跳转到消息中心界面
                context.startActivity(intent);
            } else {
                BaseEventBus bus = new BaseEventBus();
                bus.setTopic(ConstantManage.message_function_push_post);
                bus.setType(MessageStateType.untreated);
                EventBus.getDefault().post(bus);
            }
        }
    }