I am developing a messaging app.
When my app is closed and I receive a message, my backend sends a push notification to my phone.
Let’s say 1 minute later I receive another message from the same person. And again, and again, and again.
Result: I have as many notifications as messages received. I can’t do anything about it from my react-native code because the app is closed, so I am unable to listen for incoming notifications.
When I use whatsapp or messenger, even if the app is closed, the same use case would produce the following:
- John Smith : “Hey how are you?”
- John Smith : “2 messages”
- John Smith : “3 messages”
and so on.
How can I remotely change “Hey how are you?” to “2 messages”, or, how can I listen for incoming notifications while my app is closed?