So in Nougat multiple notifications from the same app get automatically bundled into a group. I'm setting a PendingIntent with some extras on my notifications and if a specific notification is tapped, it launches a specific activity (deep linking).
However, if I tap on the notification bundle (i.e. without expanding the group) my app is simply launched as if it was from the launcher - i.e. its intent is empty, there are no extras (it is not launched via the provided PendingIntent).
How can I specify an intent to use when user taps on a notification bundle?
I faced the same issue and after some investigation, it seems you cannot set a PendingIntent to be used when Android decides to automatically group the notifications.
The implementation is at NotificationManagerService.maybeAddAutobundleSummary() in AOSP sources. In this situation the system always generates a PendingIntent to just launch the launcher activity.
What you could do manage the grouping and summary notifications yourself, such as described here: http://blog.danlew.net/2017/02/07/correctly-handling-bundled-android-notifications/
Another option would be to iterate through active notifications using NotificationManager.getActiveNotifications() when the app is launched and then decide what to do (e.g. handle a pending deep link if found).
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With