quickblox

Is there a way for message to have read status in quickblox group chat only after everyone in group have read it


Me and my team are working on React app and are using QuickBlox for chat feature. We have one on one chat and group chat features. I have searched very carefully in documentation but was not able to find answer to the question: 'Is there a way for message to have read status in quickblox group chat only after everyone in group have read it'?


Solution

  • In order to mark a message as 'read' only after all occupants of a group dialog have read the message, you could use the read_ids field of response to the retrieve messages API call, as shown in this section of QuickBlox documentation.

    This field contains user IDs that have read the message, for example: "read_ids": [2792283,4374458]. In this way, you can compare this array to the array of all occupants and if their length is the same, display it as 'read' on your UI.