1.问题:无法获取deviceToken,打印log提示accs bindapp error
解决方案:按着官方文档一步一步配置,看看是不是少了jar包,一般都是集成缺东西
2.问题:收到通知没有弹出悬浮窗
解决方案:在设置里面找到该app看看是否打开了悬浮窗设置,没有打开即可,如果打开之后还没弹 出悬浮窗,可能就是因为没有申请channel渠道(小米手机)
3.问题:点击通知跳转规定页面
解决方案:UmengNotificationClickHandler方法
UmengNotificationClickHandler notificationClickHandler = new UmengNotificationClickHandler() {
@Override
public void handleMessage(Context context, UMessage msg) { //这个方法里面跳转
super.handleMessage(context, msg);
LogUtil.d("凉城推送handle",msg.getRaw().toString());
if (msg != null && msg.extra != null && msg.extra.containsKey("opt")) {
String opt = msg.extra.get("opt");
if (instance == null)
return;
Intent intent = null;
BaseInfo baseInfo = new BaseInfo();
switch (opt) {
case "200":
String title = msg.title;
String text = msg.text;
String messageId = msg.extra.get("messageId");
String publish_time = msg.extra.get("publish_time");
String status = msg.extra.get("status");
baseInfo.saveInfo("title", title);
baseInfo.saveInfo("content", text);
baseInfo.saveInfo("message_id",messageId);
baseInfo.saveInfo("message_title", "系统消息");
baseInfo.saveInfo("time",publish_time);
baseInfo.saveInfo("status", status);
intent = new Intent(context, BaseTextActivity.class);
intent.putExtra(getString(R.string.tag_key_obj), baseInfo);
intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
context.startActivity(intent);
break;
}
}
}
@Override
public void launchApp(Context context, UMessage msg) {
super.launchApp(context, msg);
LogUtil.d("凉城推送launch", "opt=" + msg.getRaw().toString());
LogUtil.d("凉城推送launch11", msg.extra.toString() + "\n" + msg.extra.get("opt"));
}
@Override
public void openActivity(Context pContext, UMessage pUMessage) {
super.openActivity(pContext, pUMessage);
LogUtil.d("凉城推送open", "opt=" + pUMessage.getRaw().toString());
}
@Override
public void dealWithCustomAction(Context context, UMessage msg) {
LogUtil.d("凉城推送action", "opt=" + msg.getRaw().toString());
}
};