i have tried below lines of code to get the multiple notification lilke whatsapp but did not get solution please check my code and let me know where am i doing wrong?
I am using the fcm to achieve this, please help me to short out from this problem
Intent intent = new Intent(this, MainActivity.class);
intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
PendingIntent pendingIntent = PendingIntent.getActivity(this, 0, intent,
PendingIntent.FLAG_ONE_SHOT);
Uri defaultSoundUri= RingtoneManager.getDefaultUri(RingtoneManager.TYPE_NOTIFICATION);
NotificationCompat.Builder notificationBuilder = new NotificationCompat.Builder(this)
.setSmallIcon(R.mipmap.ic_launcher)
.setContentTitle("Firebase Push Notification")
.setContentText(messageBody)
.setAutoCancel(true)
.setSound(defaultSoundUri)
.setContentIntent(pendingIntent)
.setNumber(4);
numMessages=numMessages+1;
for (int i = 0; i <= numMessages; i++) {
notificationBuilder.setContentText(messageBody)
.setNumber(numMessages);
NotificationManager notificationManager =
(NotificationManager) getSystemService(Context.NOTIFICATION_SERVICE);
notificationManager.notify(0, notificationBuilder.build());
}
Please check the below image, in which i have showed that which type of group message i want to implement using FCM