How to stop new push notification being replaced by the old one in Firebase?

前端 未结 2 1240
迷失自我
迷失自我 2020-12-21 11:53

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:

2条回答
  •  礼貌的吻别
    2020-12-21 12:21

    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());
    

提交回复
热议问题