【问题标题】:Mobile first server - only last notification show up in Android Device when multiple push notification are sent移动第一服务器 - 发送多个推送通知时,Android 设备中仅显示最后一个通知
【发布时间】:2016-04-05 03:55:01
【问题描述】:

我们使用移动优先服务器推送 API 为 Apple 和 Android 实现了推送通知。当我们向单个用户发送多个推送通知时,Apple 设备将收到所有通知,但在 Android 中仅显示最后一条消息。有谁知道如何解决这个问题。它与移动优先平台配置有关吗?还是设备问题?

【问题讨论】:

  • 只使用不同的通知ID或自动生成的ID
  • 那么你如何确认只收到最后一条通知

标签: mobile ibm-mobilefirst


【解决方案1】:
NotificationManager notificationManager = (NotificationManager) getSystemService(Context.NOTIFICATION_SERVICE);

        Notification notification = new NotificationCompat.Builder(ChimmerIntentService.this).setContentTitle(app_name).setSmallIcon(icon_ID).setContentText(message)
                .setDefaults(Notification.DEFAULT_SOUND).setAutoCancel(true).setContentIntent(pendingIntent).build();

        notification.flags |= Notification.FLAG_AUTO_CANCEL;

        notificationManager.notify(notificationTag, notificationID, notification);


In this method we pass notification id every time you need to pass unique id for each notification.

notificationManager.notify(notificationTag, notificationID, notification);

May be you pass the same notification id  every time when a new notification is comming because of same id it replace the privious one.

【讨论】:

  • 这个是混合APP的解决方案吗?我猜这仅适用于 Android?
  • 两者都需要每次都传递唯一的 id,直到通知区域中的所有通知都不清楚
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 2013-12-07
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2016-05-06
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多