GCM message is getting overridden

后端 未结 4 1686
爱一瞬间的悲伤
爱一瞬间的悲伤 2021-01-14 11:43

I am using GCM push notification to pass some notification to the user. My problem is when am sending single message then this works fine if send more than one then the last

4条回答
  •  一个人的身影
    2021-01-14 12:36

    Quite late to answer for the thread but felt it will be helpful for someone. The same implementation works fine for FCM firebase implementation as well

    // Get a random value 
    int notificationId = new Random().nextInt();
    // Add the notification ID which is unique as a first value of the notify method.
    notificationManager.notify(notificationId, notificationBuilder.build());
    

提交回复
热议问题