百度推送,使用了百度的开发文档的Demo,在FrontiaPushMessageReceiver的类中的
onNotificationClicked的方法中含有三个参数,只能得到前两个,而后一个始终为null,
但是在后台推送的消息中包含了三个参数,是什么原因导致第三个参数为空?
安卓百度推送点击问题
- 写回答
- 好问题 0 提建议
- 追加酬金
- 关注问题
- 邀请回答
-
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){
}
}解决 无用评论 打赏 举报