Favourite messages

Favourite messags is feature which allows users to mark some messages as favourites. so that they can see those important messages in future without searching for them in chat. Once you marked messages as favourite, you can get those from sdk to show it in your app's screen.

ArgumentTypeDescription
MESSAGE_IDStringmessageId of the message
CHAT_USER_JIDStringjid of the chat user
IS_FAVOURITEbooleantrue, if you are adding to favourites.false to remove from favourites
CALLBACKChatActionListenercallback to observe the action status

Make favourite#

You can mark the messages as favourite by using the below method.

    ChatManager.updateFavouriteStatus(MESSAGE_ID, CHAT_USER_JID, true) {isSuccess,error,message in
    }

    Remove favourite#

    You can remove the messages from favourite by using the below method.

      ChatManager.updateFavouriteStatus(MESSAGE_ID, CHAT_USER_JID, false) {isSuccess,error,message in
      }

      Get all favourite messages#

      The below method will return all the favourite messages from the local db.

        let favouriteMessages = ChatManager.getFavouriteMessages()

        Unfavorite all the favourite messages#

        You can unfavourite all the favourite messages by using the below method.

          ChatManager.unFavouriteAllFavouriteMessages { isSuccess, error, data in
          }
          caution

          If favourite message feature unavailable for your plan then it will throw 403 exception.