Integrate Private Chat Message | MirrorFly Chat SDK Guide

You can lock a chat by tapping the name of a one-to-one or group and selecting the lock option

Set Private Chat#

Private Chat can be enabled/disabled by calling this method.

ChatManager.setPrivateChat(JID, Boolean);
ArgumentDescriptionType
JIDStringjid of the user/group to enable/disable private chat
BOOLEANBooleantrue to enable the private chat false to disable the private chat

Private Chat Status#

To get the private chat status call the below method.

ChatManager.isPrivateChat();
info

The private chat status will be returned either True or False

Get Private Chats List#

An private chat won't be listed in recent chat list. To get the list of private chats call the below method.

ArrayList<RecentChat> recentChatList = ChatManager.getPrivateChatList();
or
ChatManager.getPrivateChatList((isSuccess, throwable, data) -> {
if (isSuccess) {
ArrayList<RecentChat> privateChatList = (ArrayList<RecentChat>) data.get("data");
//update the UI
} else {
//Fetching private chat list failed print throwable to find the exception details.
}
});
ArgumentDescriptionType
CALLBACKFlyCallbackFlyCallback implemented as lambda expression
info

The method with callback runs on background thread and the one without callback didn't run on background thread

Unread count#

If you want to get the unread count of private chat messages, you can utilise the below method.

int unreadPrivateMessageCount = FlyMessenger.getUnreadPrivateChatMessagesCount();