友盟推送点击通知栏不执行UmengNotificationClickHandler方法
来源:互联网 发布:淘宝改评价怎么说 编辑:程序博客网 时间:2024/06/04 23:19
1.在application类onCreate()中添加下面代码:
//友盟推送消息定义打开动作PushAgent mPushAgent = PushAgent.getInstance(this);//注册推送服务,每次调用register方法都会回调该接口mPushAgent.register(new IUmengRegisterCallback(){ @Override public void onSuccess(String deviceToken) { //注册成功会返回device token Log.v("3699umeng", "友盟推送注册成功"); } @Override public void onFailure(String s, String s1) { Log.v("3699umeng", "友盟推送注册失败" + s + " " + s1); }});UmengNotificationClickHandler notificationClickHandler = new UmengNotificationClickHandler(){ @Override public void dealWithCustomAction(Context context, UMessage msg) { Toast.makeText(context, "haha", Toast.LENGTH_LONG).show(); }}mPushAgent.setNotificationClickHandler(notificationClickHandler);
2.应用只在application中定义以上UmengNotificationClickHandler方法,不要在activity中重写该方法,否则会被复用的,导致点击通知栏只会走activity里面的UmengNotificationClickHandler法,而不会走application里面的UmengNotificationClickHandler方法。
阅读全文
0 0
- 友盟推送点击通知栏不执行UmengNotificationClickHandler方法
- 点击通知栏中推送通知的触发事件
- 收到通知后点击通知会执行哪个方法?
- Android 百度推送 点击通知栏自定义行为
- 收到推送发送通知到通知栏点击后启动应用
- 不在appIcon上显示推送数量,但是在系统通知栏保留推送通知的方法
- 【经验】清除appIcon的推送数量,但是在系统通知栏保留推送通知的方法
- 不在appIcon上显示推送数量,但是在系统通知栏保留推送通知的方法
- 极光推送-点击通知栏跳到指定页面
- 极光推送怎么点击通知跳转页面?
- 点击推送通知时APP方法调用的几种情况
- IOS 本地推送通知方法
- iOS 关于信鸽推送点击推送通知的处理
- iOS 关于推送点击推送通知的处理
- 极光推送注册、接收、点击打开推送通知
- 极光推送 推送处理总结 点击通知跳转
- Android点击通知栏,不启动新的activity
- iOS自定义相机中的button点击方法不执行
- C语言数据结构动态线性表的操作集
- python问题unindent does not match any outer indentation level在pycharm平台的解决方法
- BaseRecyclerViewAdapterHelper源码解读(七) 多布局
- c++新建线程
- MySQL:创建用户并授权
- 友盟推送点击通知栏不执行UmengNotificationClickHandler方法
- GSON学习总结
- 初识 ubuntun
- mysql中index和key的区别
- TabLayout使用
- mysql的坑
- 数据库原理
- 从点对中构建二叉树,并查找两个节点所对应的最小公共祖先
- bzoj1598 [Usaco2008 Mar]牛跑步 ( 启发式搜索 A*算法 )