Skip to content

Commit fe7d113

Browse files
committed
notifications: Remove Android summary notification.
Removes the summary notification from the group in NotificationManager.kt. This allows the user to tap on the body of the notification to open the app, which was not possible with the summary notification (only the chevron would expand the notification, which would then allow the user to interact with the individual notifications below it. Please note that removing the summary notification breaks proper grouping: multiple private messages from the same user will correctly be grouped together, but stream notifications appear in a separate notification. This was tested manually. Fixes part of zulip#5242.
1 parent b1eba83 commit fe7d113

File tree

1 file changed

+0
-21
lines changed

1 file changed

+0
-21
lines changed

android/app/src/main/java/com/zulipmobile/notifications/NotificationUiManager.kt

-21
Original file line numberDiff line numberDiff line change
@@ -345,31 +345,10 @@ private fun updateNotification(
345345
setAutoCancel(true)
346346
}.build()
347347

348-
val summaryNotification = NotificationCompat.Builder(context, CHANNEL_ID).apply {
349-
setGroup(groupKey)
350-
setGroupSummary(true)
351-
352-
color = context.getColor(R.color.brandColor)
353-
setSmallIcon(if (BuildConfig.DEBUG) R.mipmap.ic_launcher else R.drawable.zulip_notification)
354-
355-
// For the summary we use an "inbox-style" notification, as recommended here:
356-
// https://developer.android.com/training/notify-user/group#set_a_group_summary
357-
setStyle(NotificationCompat.InboxStyle()
358-
// TODO(#5115): Use the org's friendly name instead of its URL.
359-
.setSummaryText(fcmMessage.identity.realmUri.toString())
360-
// TODO: Use addLine and setBigContentTitle to add some summary info when collapsed?
361-
// (See example in the linked doc.)
362-
)
363-
364-
// TODO Does this do something useful? There isn't a way to open these summary notifs.
365-
setAutoCancel(true)
366-
}.build()
367-
368348
NotificationManagerCompat.from(context).apply {
369349
// This posts the notifications. If there is an existing notification
370350
// with the same tag and ID as one of these calls to `notify`, this will
371351
// replace it with the updated notification we've just constructed.
372-
notify(groupKey, NOTIFICATION_ID, summaryNotification)
373352
notify(conversationKey, NOTIFICATION_ID, notification)
374353
}
375354
}

0 commit comments

Comments
 (0)