'Is there a Firebase event to explicitly express that an Android push notification is being rendered and the user has viewed it?

Why? Because this is useful for Analytics

From this list of events: https://support.google.com/firebase/answer/9234069

First of all we have the notification_send which makes little sense to me but might be the first event we receive

Then we have that we either get notification_foreground or notification_receive depending on whether the app received the notification while the app was in the foreground or not correspondingly

Obviously the user has two options: To either dismiss this single notification with notification_dismiss or open it with notification_open

However is there a way to understand or use an explicit event in the code that the push notification was rendered to the user at all ?

Because imagine the case where the user has a large list of notifications and cannot even view our notification in the status bar. And then the user taps on Clear All. If the notification_dismiss is recorded this is not exactly correct.

Because it is completely different if the user has viewed/read the notification but dismissed it nevertheless and different if the user never saw the notification and just cleared all his/her notifications.

In a nutshell we are looking to have a notification_viewed or notification_impression however you want to call

Is this something that can be done through code ? https://developer.android.com/reference/androidx/core/app/NotificationCompat.Builder <-- a quick glance to this link seems like the answer is no but maybe there is another way ?



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source