I have used FCM to receive notifications. When I receive multiple notifications it fills up the notification status bar. How do I group them into one?
My code:
PendingIntent pendingIntent = PendingIntent.getActivity(this, 0 /* Request code */, intent,
PendingIntent.FLAG_UPDATE_CURRENT);
Uri defaultSoundUri = RingtoneManager.getDefaultUri(RingtoneManager.TYPE_NOTIFICATION);
NotificationCompat.Builder notificationBuilder = new NotificationCompat.Builder(this)
.setContentTitle("ABC")
.setPriority(Notification.PRIORITY_HIGH)
.setContentText(messageBody)
.setAutoCancel(true)
.setSound(defaultSoundUri)
.setGroup(GROUP_KEY_NOTIFICATIONS)
.setContentIntent(pendingIntent);
Using setGroup() it is not working.
Edit:
.setGroupSummary(true)
is working for OS lollipop but not in marshmallow. Can you please help