Hello Gliders,
I have a chat on my app and I was hoping to add read receipts if possible.
Does anyone know how to do this?
Hello Gliders,
I have a chat on my app and I was hoping to add read receipts if possible.
Does anyone know how to do this?
Is it a 1:1 or 1:many chat?
Essentially what you want is a custom action that writes a timestamp to a column when a user navigates to a chat message. If your chat is 1:1 that should be pretty straightforward. If it’s a 1:many chat, then it’s a little more complex, and depending how you set it up could use a lot of rows.
Hello Darren,
It is a 1:many (7 users). When you say navigates to the chat message do you mean click on it or open the app? How would this be impacted if the window was left open but not active?
Appreciate any help.
It gets complicated because with read receipts, you want the “other people” to see it.
Let’s take an example, I used to have clients asking me if I can show read/unread conversations to the signed-in user. In that scenario, I can just have a user-specific timestamp column that I set every time the user navigates to the chat’s details view.
If there are any messages that are sent after that timestamp, then I can show it as “unread”, and vice versa.
For receipts, due to the nature of chats, you don’t usually “click” on messages to have a point of interaction, I think your best bet is still doing what I did above, but you have to log it to a helper table because if you use user-specific, other people can not see the data.
Chat ID | User ID | Timestamp |
---|---|---|
C001 | U001 | Feb 9 2025, 7AM |
C002 | U001 | Feb 9 2025, 9AM |
Then, you can play around with that data to show at which point did a user last read the chat.