wjc
4 天以前 acccdeba7fe28f7f4b72ba464ad4789b0d9ddb2a
app/src/main/java/com/hdl/photovoltaic/other/HdlPushLogic.java
@@ -65,7 +65,7 @@
        json.addProperty("deviceType", "Android");//设备类型
        json.addProperty("produce", AppConfigManage.isIsOnlineServer());//表示是否是正式服务器
        json.addProperty("pushToken", UserConfigManage.getInstance().getPushToken());//App的推送Token,在极光为RegId
        json.addProperty("software", "PHOTOVOLTAIC");//软件来源把PHOTOVOLTAIC改成XENTERRA,也就云端说的通道号(channel)
        json.addProperty("software", "PHOTOVOLTAIC");//也就云端说的通道号(channel)
        json.addProperty("platform", "ALIYUN_APNS");//阿里云的版本的platform
//        json.addProperty("platform", "FCM");//google的版本的platform
        json.addProperty("language", UserConfigManage.getInstance().getCurrentAppLanguage());//2.0追加的字段
@@ -130,52 +130,29 @@
     *
     * @param context             上下文
     * @param pushMessageInfoBean 推送数据对象实体
     * @param isOpened            true=点击通知栏回调,false=收到推送通知回调;
     * @param isAppInForeground   true表示是前台,false表示后台
     */
    public void PushPushCommonData(Context context, PushMessageInfoBean pushMessageInfoBean, boolean isOpened) {
    public void PushPushCommonData(Context context, PushMessageInfoBean pushMessageInfoBean, boolean isAppInForeground) {
        if (UserConfigManage.getInstance().isBAccount()) {
            //添加推送数据到缓存列表中;
//            this.addPushDataToMemoryList(pushMessageInfoBean);
            if (isOpened) {
//                //安装商跳转界面
//                Intent intent = new Intent(context, BPowerStationActivity.class);
//                intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_CLEAR_TOP);
//                intent.putExtra("skip", "skip");//里面判断有这个标识就跳转到消息中心界面
//                context.startActivity(intent);
            } else {
            if (isAppInForeground) {
                //应用在前台通知更新住宅消息列表即可
                BaseEventBus bus = new BaseEventBus();
                bus.setTopic(ConstantManage.refresh_message_house);
                bus.setType(ConstantManage.refresh_message_house);
                EventBus.getDefault().post(bus);
                EventBus.getDefault().postSticky(bus);
            } else {
                // 安装商跳转界面
//                Intent intent = new Intent(context, BPowerStationActivity.class);
//                intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_CLEAR_TOP);
//                intent.putExtra("skip", "skip");//里面判断有这个标识就跳转到消息中心界面
//                context.startActivity(intent);
            }
        } else {
//            if (isOpened) {
            //产品经理说暂时不做 2024年03月29日10:34:44
//                boolean existsActivity = AppManagerUtils.getAppManager().existsActivity(MessageCenterListActivity.class);
//                if (existsActivity) {
//                    //存在唯一一种可能就是当前活动窗口就是它
//                    return;
//                }
//                //跳转C端消息中心界面
//                Intent intent = new Intent(context, MessageCenterListActivity.class);
//                intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_CLEAR_TOP);
//                context.startActivity(intent);
//                //不管存不存在这些Activity(找到才移除),都要做这些动作,有可能当前的活动窗口是其中一个
//                AppManagerUtils.getAppManager().finishActivity(AccountAndSecurityActivity.class);
//                AppManagerUtils.getAppManager().finishActivity(AsRegardsActivity.class);
//                AppManagerUtils.getAppManager().finishActivity(BindMailActivity.class);
//                AppManagerUtils.getAppManager().finishActivity(BindPhoneActivity.class);
//                AppManagerUtils.getAppManager().finishActivity(languageSelectionActivity.class);
//                AppManagerUtils.getAppManager().finishActivity(MeChangePasswordActivity.class);
//                AppManagerUtils.getAppManager().finishActivity(PersonalDataActivity.class);
//                AppManagerUtils.getAppManager().finishActivity(SetActivity.class);
//                AppManagerUtils.getAppManager().finishActivity(TemperatureUnitActivity.class);
//                AppManagerUtils.getAppManager().finishActivity(WebActivity.class);
//                //通知uni移除界面
//                HDLUniMP.UniCallBackBaseBean uniCallBackBaseBean = new HDLUniMP.UniCallBackBaseBean();
//                uniCallBackBaseBean.setType(HDLUniMP.UNI_EVENT_NOTIFICATION_REMOVE_VIEW);
//                HdlUniLogic.getInstance().sendUni(HDLUniMP.UNI_EVENT_NOTIFICATION_DEVICE_MODEL, uniCallBackBaseBean);
//            }
        }
    }