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, message) -> {
});

Remove favourite#

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

ChatManager.updateFavouriteStatus(MESSAGE_ID, CHAT_USER_JID, false, (isSuccess, message) -> {
});

Get all favourite messages#

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

List<ChatMessage> favouriteMessages = FlyMessenger.getFavouriteMessages();

Unfavorite all the favourite messages#

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

ChatManager.unFavouriteAllFavouriteMessages((isSuccess, message) -> {
if(isSuccess){
//Unfavourite success update the UI
}else{
// Unfavourite failed print message to know the error
}
})
caution

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