识别发布/删除的通知何时在组中

Recognize when a notification posted / removed is in a group

我正在尝试使用 NotificationListenerService 检查 StatusBarNotifications(显示在 StatusBar 中)是否是组(例如邮件或消息)固有的。我正在使用 sdk >= 21.

使用 fb、whatsapp 或 gmail 等应用程序 well-known 我看到了不同的标记分组消息的规则(组和关键属性 - StatusBarNotification - 为此目的管理起来并不容易) .

如何识别发布/删除的通知是否在群组中? header 是哪个组?

仅使用 StatusBarNotification 不可能实现此目的。但是可以用 onNotificationRemoved/Posted & getActiveNotifications.

做一些事情