I am implementing a group chat feature. I am using push notifications to notify all devices in the chat session at a new message is available on the server, and therefore to trigger a call to the database to synchronize new messages.
Currently almost everything works. Sending messages, synchronizing messages, receiving notifications, etc. But, every time a notification is received, the user has to manually clear it. Even if they are currently using the app and in the chat feature.
How do I prevent notifications from staying in the phone notification area when they have already been received and processed by the app?
Additionally, is it possible to send more information in a push notification than just a simple string message? I suppose I could use JSON.stringify(), but then the user has to see a bunch of ugly data information in their notification pop-up.