I'm looking for an efficient way to get and update count of unread messages in twilio chat. I've reviewed related Q&A here (like this), and the anser was about looping through the Channel's array and Message Consumption Horizon. Is it the one way to solve it? It's not a cheap approach from the point of view of perfomance.
The second question is about ability to update this count on the fly - so, is there a way to create a notification for user with event handler for incomming messages (not push notifications) to update counter of unread messages in real time?
thanks in advance