When I trigger a push notification then the old one is replaced by new one. But I want it should add to that old notification.
My MyFirebaseMessaging class is:
you have to do like below
private final static AtomicInteger c = new AtomicInteger(0);
public static int getID() {
return c.incrementAndGet();
}
your list line should be replace with below
notificationManager.notify(getID(), notificationBuilder.build());
new push notification is replaced the old one in firebase push notification in my application,How i will stop this
You need to pas different notificationID
in notificationManager.notify()
SAMPLE CODE
Date myDate = new Date();
int myNotificationId = Integer.parseInt(new SimpleDateFormat("ddhhmmss", Locale.US).format(myDate));
notificationManager.notify(myNotificationId,notificationBuilder.build());