Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to collapse/group expo notifications

Hello everybody

I'm currently developing an application that uses expo for push notifications. This app includes a chat feature that notifies the user of each message. The real problem is that these notifications are not collapsing immediately so the user gets a lot of notifications before android automatically decides to collapse.

Here's what is happening.

[App] John Doe
 Hello dude.
[App] John Doe
 How are you?
[App] John Doe
 Pay me!!!

The expected behaviour

[App] John Doe
  Hello dude
  How are you?
  Pay me!!!
like image 742
Roberto Avatar asked Oct 16 '25 17:10

Roberto


1 Answers

It seems like IOS automatically group all your App notifications into one thread. However, on Android you need to set notification.androidMode to collapse, which is not set by default.

Take a look at current documentation: https://docs.expo.dev/versions/latest/config/app/#androidmode

app.json

Path: notification.androidMode
Type: enum

Show each push notification individually (default) or collapse into one (collapse).

That will only work in standalone app, nor in Expo Go.

like image 155
Dzmitry Dranitski Avatar answered Oct 18 '25 07:10

Dzmitry Dranitski



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!