Message Receipts

Overview#

Message receipts is a feature which allows users to know the status of the sent messages as well as the delivered and read time for the messages. The chat app users are well informed about the status of the sent messages.

info

To obserserve message's sent, delivered, read status refer the message delegates.

You need to update the ongoing chat user jid always whenever you are entering/exiting the chat window of user by using below method. it is used by sdk internally for receipts.

In ViewController viewDidAppear, set the user jid as ongoing chat user.

ArgumentTypeDescription
JIDStringjid of the chat user
    override func viewDidAppear(_ animated: Bool) {
    super.viewDidAppear(animated)
    ChatManager.setOnGoingChatUser(jid: JID) // set jid of the chat user
    }

    Then, in ViewController viewDidDisappear, clear the ongoing chat user.

      override func viewDidDisappear(_ animated: Bool) {
      super.viewDidDisappear(animated)
      ChatManager.setOnGoingChatUser(jid: "") // set as empty on disappear
      }

      Mark messages as delivered#

      You don't need to send the delivery receipts explicitly, it will be automatically sent by the sdk.

      Mark a conversation as read#

      By marking a converstaion as read the unread count will be reset and it is considered the message inside the conversation were read by you.

        ChatManager.markConversationAsRead(for:JID_LIST)
        ArgumentTypeDescription
        JID_LIST[String]List of user/group jid

        Mark a conversation as Unread#

        By marking a converstaion as unread it is considered the message inside the conversation were in unread state.

          ChatManager.markConversationAsUnread(JID_LIST)
          ArgumentTypeDescription
          JID_LIST[String]List of user/group jid
          info

          The read/unread flag is available as a property in the name of isConversationUnRead in the RecentChat for a user.

          Remove unread message separator#

          To remove the unread message separator in a chat conversation list call the below method.

            FlyMessenger.deleteUnreadMessageSeparatorOfAConversation(JID)
            ArgumentTypeDescription
            JID_LIST[String]List of user/group jid

            Group Message Delivered list#

            To get the list of users to whom a message was successfully delivered call the below method.

              GroupManager.shared.getMessageDeliveredListBy(messageId: MESSAGE_ID, groupId:groupId )

              Refer this doc to know more about MessageStatusDetail Class

              info

              Only messages sent by the current user will have the options to get delivered and read list.

              ArgumentTypeDescription
              MESSAGE_IDStringMessageID of the message
              groupIdstringgroupJID of the Group

              Group Message Read list#

              To get the list of users whom are read/seen the message call the below method.

                GroupManager.shared.getMessageSeenListBy(messageId:MESSAGE_ID , groupId:groupId )
                info

                Only messages sent by the current user will have the options to get delivered and read list.

                ArgumentTypeDescription
                MESSAGE_IDStringMessageID of the message
                groupIdstringgroupJID of the Group