| | |
| | | package com.hdl.photovoltaic.jpush; |
| | | |
| | | import android.content.Context; |
| | | import android.content.Intent; |
| | | import android.os.Bundle; |
| | | |
| | | import com.google.gson.Gson; |
| | | import com.hdl.photovoltaic.config.ConstantManage; |
| | | import com.hdl.photovoltaic.other.HdlLogLogic; |
| | | import com.hdl.photovoltaic.ui.MyPowerStationActivity; |
| | | import com.hdl.photovoltaic.ui.StartActivity; |
| | | import com.hdl.photovoltaic.ui.bean.BUserInfo; |
| | | import com.hdl.sdk.link.core.bean.eventbus.BaseEventBus; |
| | | |
| | | import org.greenrobot.eventbus.EventBus; |
| | | |
| | | import cn.jpush.android.api.CustomMessage; |
| | | import cn.jpush.android.api.JPushInterface; |
| | | import cn.jpush.android.api.NotificationMessage; |
| | | import cn.jpush.android.service.JPushMessageService; |
| | | |
| | |
| | | * @param message 接收到的通知内容 |
| | | */ |
| | | public void onNotifyMessageOpened(Context context, NotificationMessage message) { |
| | | |
| | | // //点击后删除本地通知 |
| | | // JPushInterface.clearAllNotifications(context); |
| | | HdlLogLogic.print("极光--->点击通知回调--->" + new Gson().toJson(message), true); |
| | | Intent intent = new Intent(context, MyPowerStationActivity.class); |
| | | // Bundle bundle = new Bundle(); |
| | | // bundle.putString(JPushInterface.EXTRA_NOTIFICATION_TITLE, message.notificationTitle); |
| | | // bundle.putString(JPushInterface.EXTRA_ALERT, message.notificationContent); |
| | | // intent.putExtras(bundle); |
| | | intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_CLEAR_TOP); |
| | | intent.putExtra("skip", "skip");//标识跳转 |
| | | context.startActivity(intent); |
| | | |
| | | BaseEventBus bus = new BaseEventBus(); |
| | | bus.setTopic(ConstantManage.message_function_push_post); |
| | | EventBus.getDefault().postSticky(bus); |
| | | |
| | | } |
| | | |