[英]Increment push notification number
I use Parse.com for my android app's backend. 我将Parse.com用于我的android应用程序的后端。 I also send some push notifications to users using Parse Cloud Code.
我还使用Parse Cloud Code向用户发送一些推送通知。 When I send multiple pushes to a user, he gets multiple push notifications, how do I increment the number in the notification in the phone rather than making multiple notifications appear?
当我向用户发送多次推送时,他会收到多个推送通知,我该如何在电话中增加通知中的号码,而不是使多个通知出现?
When you publish a Notification, you specify an ID, like so (the number 123 in this example): 发布通知时,您可以指定一个ID,如下所示(在此示例中为123):
Intent notificationIntent = new Intent(mActivity, NotificationPublisher.class);
notificationIntent.putExtra(NotificationPublisher.NOTIFICATION_ID, 123);
If you want to send a new notification, and replace this one, make sure you set the same ID when you send a new notification (which will replace the existing notification with your new content) 如果要发送新通知并替换此通知,请确保在发送新通知时设置相同的 ID(它将用新内容替换现有通知)
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.