iOS or Facebook-style read receipts within a chat window?

How do you implement iOS or Facebook-style read receipts within a chat window?

This can either be a text “Read [Relative Time]” under the message, or a user’s profile icon descending to the text they last read.

Figured it out. Add “Read” and a bunch of rules to the Message data field.

Hi Incommon

I am looking into how to do this… could you provide the rules that you created in the message data field. Perhaps screen shots or something that would allow others to do the same?

Cheers

So I put together something that I believe will work. I haven’t had the chance to test it as my app has no testing data to use but I think the logic is there for it to function properly.

In order to do the read receipts I configured my DB to have a type of conversations and a type of messages. The conversations had a list of messages as a field and messages had a field of conversation.

The conversation had a field of CurrentReader which is a list of users.
The messages had a field of UnreadMessage which is also a list of users.

I have a page that displays a users list of conversations. On a click in a RG of types conversations on a particular conversation a workflow will first add the current user to the conversations data field of CurrentReader.

When a new message is sent it is automatically saving the “receiver” to the messages data field of UnReadMessage ONLY WHEN “receiver” is not in the conversations data filed of CurrentReader.

I have on the page a workflow set to occur every 30 seconds that will remove the current page user from the messages data field of UnReadMessage. (redundant and I may remove it)

On the page I have placed an “exit intent” ( a Free plugin - detects use of back arrow or change of URL ) and fire a workflow to remove the current user from the conversations datafield of CurrentReader. I Have other workflows that remove the user from CurrentReader when the user logs out or presses an icon that is for navigation to previous page of list of conversations.

Hope this might help anybody who is thinking through a messaging app.

By the way the page also has custom states set for “sender” “receiver” and “current page user” all of which are type user. This made it easier to save this information in database as well as make the workflows work.