逍_遥_客 2015-05-29 04:57 采纳率: 0%
浏览 3632

安卓百度推送点击问题

百度推送,使用了百度的开发文档的Demo,在FrontiaPushMessageReceiver的类中的
onNotificationClicked的方法中含有三个参数,只能得到前两个,而后一个始终为null,
但是在后台推送的消息中包含了三个参数,是什么原因导致第三个参数为空?

  • 写回答

2条回答

  • WorldMobile 2015-05-29 05:23
    关注

    参考一下这个例子

    接收推送
    功能描述
    接收推送消息和通知,以及接口start、stop、setTags、deleteTags和listTags的返回值,开发者要实现一个FrontiaPushMessageReceiver的子类,并在AndroidManifest.xml中声明它。

    FrontiaPushMessageReceiver
    回调介绍
    onBind:FrontiaPush.start绑定云推送的回调
    onUnbind:FrontiaPush.stop断开与云推送的绑定的回调
    onSetTags:FrontiaPush.setTags的回调
    onDelTags:FrontiaPush.deleteTags的回调
    onListTags:FrontiaPush.listTags的回调
    onMessage:接收推送消息的回调
    onNotificationClicked:接收推送通知的回调

    开发示例
    package com.company;

    //子类的实现
    public class MyPushMessageReceiver extends FrontiaPushMessageReceiver {

    //FrontiaPush.start() 的回调函数
    public void onBind(Context context, Intent intent, String content, int errorCode, String appid, String userId,
    String channelId, String requestId){
    }

    //FrontiaPush.stop() 的回调函数
    public void onUnbind(Context context, Intent intent, String content, int errorCode, String requestId){
    }

    //FrontiaPush.setTags() 的回调函数
    public void onSetTags(Context context, Intent intent, String content, int errorCode, List successTags,
    List failTags, String requestId){
    }

    //FrontiaPush.deleteTags() 的回调函数
    public void onDelTags(Context context, Intent intent, String content,
    int errorCode, List successTags, List failTags, String requestId){
    }

    //FrontiaPush.listTags() 的回调函数
    public void onListTags(Context context, Intent intent, String content,
    int errorCode, List tags, String requestId){
    }

    //接收推送消息的回调函数
    public void onMessage(Context context, Intent intent, String message, String customContentString){
    }

    //接收推送通知的回调函数
    public void onNotificationClicked(Context context, Intent intent,
    String title, String description, String customContentString){
    }
    }

    评论

报告相同问题?

悬赏问题

  • ¥30 这是哪个作者做的宝宝起名网站
  • ¥60 版本过低apk如何修改可以兼容新的安卓系统
  • ¥25 由IPR导致的DRIVER_POWER_STATE_FAILURE蓝屏
  • ¥50 有数据,怎么建立模型求影响全要素生产率的因素
  • ¥50 有数据,怎么用matlab求全要素生产率
  • ¥15 TI的insta-spin例程
  • ¥15 完成下列问题完成下列问题
  • ¥15 C#算法问题, 不知道怎么处理这个数据的转换
  • ¥15 YoloV5 第三方库的版本对照问题
  • ¥15 请完成下列相关问题!