逍_遥_客 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){
    }
    }

    评论

报告相同问题?

悬赏问题

  • ¥50 树莓派安卓APK系统签名
  • ¥15 maple软件,用solve求反函数出现rootof,怎么办?
  • ¥65 汇编语言除法溢出问题
  • ¥15 Visual Studio问题
  • ¥20 求一个html代码,有偿
  • ¥100 关于使用MATLAB中copularnd函数的问题
  • ¥20 在虚拟机的pycharm上
  • ¥15 jupyterthemes 设置完毕后没有效果
  • ¥15 matlab图像高斯低通滤波
  • ¥15 针对曲面部件的制孔路径规划,大家有什么思路吗