| | |
| | | import com.hdl.photovoltaic.jpush.JPushMessageInfoBean; |
| | | import com.hdl.photovoltaic.ui.BPowerStationActivity; |
| | | import com.hdl.photovoltaic.ui.bean.MessageBean; |
| | | import com.hdl.photovoltaic.utils.SharedPreUtils; |
| | | import com.hdl.sdk.link.core.bean.eventbus.BaseEventBus; |
| | | |
| | | import org.greenrobot.eventbus.EventBus; |
| | |
| | | public void JpushPushCommonData(Context context, JPushMessageInfoBean jPushMessageInfoBean, boolean isOpened) { |
| | | if (UserConfigManage.getInstance().isBAccount()) { |
| | | //添加推送数据到缓存列表中; |
| | | this.addPushDataToMemoryList(jPushMessageInfoBean); |
| | | // this.addPushDataToMemoryList(jPushMessageInfoBean); |
| | | if (isOpened) { |
| | | //安装商跳转界面 |
| | | Intent intent = new Intent(context, BPowerStationActivity.class); |
| | |
| | | } else { |
| | | if (isOpened) { |
| | | //产品经理说暂时不做 2024年03月29日10:34:44 |
| | | // boolean existsActivity = AppManagerUtils.getAppManager().existsActivity(MessageCenterList.class); |
| | | // boolean existsActivity = AppManagerUtils.getAppManager().existsActivity(MessageCenterListActivity.class); |
| | | // if (existsActivity) { |
| | | // //存在唯一一种可能就是当前活动窗口就是它 |
| | | // return; |
| | | // } |
| | | // //跳转C端消息中心界面 |
| | | // Intent intent = new Intent(context, MessageCenterList.class); |
| | | // Intent intent = new Intent(context, MessageCenterListActivity.class); |
| | | // intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_CLEAR_TOP); |
| | | // context.startActivity(intent); |
| | | // //不管存不存在这些Activity(找到才移除),都要做这些动作,有可能当前的活动窗口是其中一个 |
| | |
| | | */ |
| | | private void addPushDataToMemoryList(JPushMessageInfoBean jPushMessageInfoBean) { |
| | | try { |
| | | boolean isPushAddCache = SharedPreUtils.getBoolean("pushAddCache"); |
| | | if (!isPushAddCache) { |
| | | //有可能删除推送Token接口失败,换账号后,依然也会收到上次账号的推送; |
| | | return; |
| | | } |
| | | if (TextUtils.isEmpty(jPushMessageInfoBean.getExpantContent())) { |
| | | return; |
| | | } |
| | |
| | | messageBean.setTitle(jPushMessageInfoBean.getContent()); |
| | | messageBean.setDeviceDesc(jPushMessageInfoBean.getContent()); |
| | | HdlMessageLogic.getInstance().setListMessage(messageBean, 0); |
| | | HdlLogLogic.print("极光推送--->添加在推送数据到缓存列表中--->" + new Gson().toJson(jPushMessageInfoBean)); |
| | | HdlLogLogic.print("极光推送---添加在推送数据到缓存列表中---" + new Gson().toJson(jPushMessageInfoBean)); |
| | | } catch (Exception ignored) { |
| | | } |
| | | } |