发送推送通知..正确但来自同一解析的通知用户显示重复的消息。我想要像whatsapp一样的消息计数.....请帮助我
答案 0 :(得分:1)
这称为 InboxStyle通知,以下是实现该功能的示例代码。
Notification notification = new Notification.InboxStyle(new Notification.Builder(context)
.setTicker(message)
.setSmallIcon(icon)
.setContentTitle(title)
.setContentText(subTitle)
.setNumber(3)
.setContentIntent(intent))
.addLine("Hi")
.addLine("Hello")
.addLine("How are you?")
.setBigContentTitle("Custom message")
.setSummaryText("+8 more")
.build();