Unread Chat message notification

Hi all,

I have just implemented a private chat option into my app (following GRUMO’s fantastic tutorial here: https://www.youtube.com/watch?v=u9uP71LHFp0)

I’m trying to figure out a way that will show a user that there’s been a new message sent to them in a chat since their last log in, so that I can display a symbol or some kind of message to inform them. I’d like the boolean (or whatever is used) to then be set to false once the user opens the chat in question.

My initial thought was to create 2 Booleans in my list of chats “Unread A” and “Unread B” and set “Unread A” to be true when user B posts and vice versa. When User A opens the chat, it would then set “Unread A” to false, likewise for user B. If the boolean is true, it’d show an emoticon or something by the chat in the chat list to indicate there’s a new chat.

While this should work for private chats between two people, the issue comes looking ahead where I am wanting to implement larger chat rooms for specific groups of people (based on things such as regions) where there would be more than 2 people in the room. How can I implement this system so that it works for 2 person and multi-person chats?

Rather than booleans, I would use a single User Specific datetime column. Initially it would be empty for each user, then as each reads the message use a Set Column Values action to fill it with the current datetime. Because it is User Specific, every user will see a different value.

2 Likes

Thank you Darren! That seems to be working great!

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.