0

I am developing an app in which i want to display push notifications.I implemented that and i am getting notifications well.But when i get two or more notifications the whole notification drawer is occupied by the notifications.I want to display the notifications in single notification if we get multiple notifications.

For example:

I got a message from user-A and i will get a notification.I didn't read the message and then i got other message from user-B and i will get another notification.

Here what i want is to display those two notifications as "2 messages received" in a single notification instead of two separate notifications.

Please help me to solve this issue.I will be thankful for your help.

Thank you.

Praveen Baruri
  • 330
  • 3
  • 19
  • In the code you receive the message, you set an ID to that notification. I guess that you can handle it keeping a single ID to manage the notifications – Diego Rafael Souza Oct 31 '17 at 09:02
  • Thanks for your response Diego.But how can i get the notifications count in notification drawer? – Praveen Baruri Oct 31 '17 at 09:09
  • It's about expand and contract the notification. Take a look [here](https://stackoverflow.com/questions/18102052/how-to-display-multiple-notifications-in-android) and [here](https://developer.android.com/design/patterns/notifications_k.html). I hope it helps you. – Diego Rafael Souza Oct 31 '17 at 09:46
  • Thanks Diego.But the new notification is replacing the old one.I used the below code: int m = (int)(Convert.ToInt32((new DateTime().TimeOfDay.Minutes) / 1000) % int.MaxValue); notificationManager.Notify(m, notification); Please help me with any suggestion – Praveen Baruri Nov 01 '17 at 13:49
  • Did you looked that links? The first one is about this problem you're having – Diego Rafael Souza Nov 01 '17 at 14:00
  • Are you saying about this=> notificationManager.notify(Unique_Integer_Number, notification); – Praveen Baruri Nov 01 '17 at 14:03
  • No, I do about the accepted answer. – Diego Rafael Souza Nov 01 '17 at 14:10

0 Answers0