4

Update: I solved it by setting

            .setGroupAlertBehavior(GROUP_ALERT_SUMMARY)

I am creating notifications like

new NotificationCompat.Builder(context, channel_id)
            .setColor(..)
            .setContentTitle(..)
            .setSubText(..)
            .setSmallIcon(..)
            .setAutoCancel(true)
            .setGroup(groupKey)
            .setGroupSummary(true)
            .setContentIntent(resultPendingIntent)
            .build();

On 8.0 some devices are seeing double notification sound for every notification. There is a blog post around this

Some apps seem to have figured out a way to solve the issue? Help!

Anand Khinvasara
  • 618
  • 4
  • 17

3 Answers3

2

.setGroupAlertBehavior(GROUP_ALERT_SUMMARY)

Anand Khinvasara
  • 618
  • 4
  • 17
-1

Because of new "Notification channels" introduced in android O, you need to create notification channel and set NotificationManager.IMPORTANCE_LOW to it.

Check this

Roman Spurdo
  • 172
  • 1
  • 6
-1

You need to define notifications Group. then, you need to set the setGroupAlertBehavior, like @Anand Khinvasara's answer

notificationBuilder.setGroup("com.YOUR_PACKAGE_ID.NOTIFICATIONS_GROUP");
notificationBuilder.setGroupAlertBehavior(NotificationCompat.GROUP_ALERT_SUMMARY);
avisper
  • 878
  • 12
  • 11