简体   繁体   中英

Increment push notification number

I use Parse.com for my android app's backend. I also send some push notifications to users using 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):

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)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM