Monday 30 December 2019

How to detect that a notification bundle/group was clicked in Android?

In Android Nougat and above, push notifications for your app are grouped together automatically after the # 4th.

The problem in Android is that clicking on the bundle does not expand the push notification list, it opens the app.

I have a requirement to identify users that opened the app trough a push notification. For individual notifications this is easy since I can explore intent extras. The problem with the bundle is that extras is null and intent looks exactly the same as if user clicked on launcher icon. I have no way to detect that navigation was done from a push notification :(

Just in case it's not clear: I'm not using push notifications groups explicitly, this is done automatically by Android. I have not set any group key to the notifications.

Not sure if helps somehow but notifications are generated server side and not client side.



from How to detect that a notification bundle/group was clicked in Android?

No comments:

Post a Comment