Add a new notification when push notification is received (not replace the previous)

前端 未结 6 1963
予麋鹿
予麋鹿 2021-02-02 16:59

I am using push notifications in my app. I need to display a notification when a push notification delivered. If I send another notification (without clearing the previous notif

6条回答
  •  不要未来只要你来
    2021-02-02 17:34

    You can also use System.currentTimeMillis() to assign unique id to your notification.

    int id = (int) System.currentTimeMillis();
    mNotificationManager.notify(id, notification);
    

提交回复
热议问题