androidnotificationsnotification-channel

Two notifications with same ID but diffrent Noification channels


I'm generating two local notifications from my app using two different notification channel. notification configurations will be as below,

1.) Notification1 (notification_channel: msg_1 and notification_id: 1)

2.) Notification2 (notification_channel: msg_2 and notification_id: 1)

What will happen in this case?

It will show single notification OR It will show two separate notification

I want to know the expected behaviour from your end?


Solution

  • I've explored about the scenario & it will display as diffrent notification because OS use notificationId to show notification seperately in notificaition stack on tray. If you pass same notificationId ,OS will just overlap older notification with the new one.

    Also, notification channel configurations are just applied to notificationId to show specific behaviour.