Other chat features
Report User/Group Messages#
This feature is used to do report the user/group messages by selecting the message or user/group profile. If the user/group is reported by person to admin, the user's last 5 conversations or by selecting along with the selected message and previous 4 messages will be sent to the admin panel based on that chats availability. By using the below method person can achieve the User/Group report messages.
- Java
- Kotlin
Note : In this method
SELECTED_MIDis optional argument. If person selected a message to report use this param other wise ignore the param.
| Argument | Type | Description | 
|---|---|---|
| TO_USER_JID | string | Report User Jid who needs to be reported | 
| CHAT_TYPE | string | User chat type either single chatorgroup chat | 
| SELECTED_MID | string | Selected Message ID | 
caution
If report chat feature unavailable for your plan then it will throw 403 exception.
Handling Banned User/Group#
This feature is used to get the users/groups admin blocked status. So that you can check the user/group available status and communicate with them. If user/group blocked by admin then you will get notify the alert message.
Get Own user Admin Block Status#
This method is used to get the live status of own user profile blocked/unblocked by Admin status, so that you will be navigated to show stopper screen if profile blocked by admin.
- Java
- Kotlin
Get Other user/group Admin Block Status#
This method is used to get the live status of other user/group profile blocked/unblocked by Admin status, so that you will be notified the profile status.
- Java
- Kotlin
Send typing status#
You can able to send the typing/gone status to the users, so that they can aware of whether user is typing the message or not. if you want send the typing status for a user, you can utilise the below method.
| Argument | Type | Description | 
|---|---|---|
| TO_JID | String | jid of the chat user | 
| CHAT_TYPE | ChatTypeEnum | chat type | 
While user starts typing the message in the input box of the chat window, call the below method to send the composing status, so that they can show a typing message in the header/recent chat.
- Java
- Kotlin
Once user stopped/finished typing the message in the input box of the chat window, call the below method to send the gone status, so that they can hide a typing message in the header/recent chat.
- Java
- Kotlin
Observe the typing status#
To observe the typing status changes, you can use the below method to setup listener for the typing events.
| Argument | Type | 
|---|---|
| LISTENER | TypingStatusListener | 
- Java
- Kotlin
Once the listener has been set by the sdk user, the below callbacks will be triggered based on the chat type.
Single chat#
for single chat below callback will be triggered
Callback arguments#
| Argument | Type | Description | 
|---|---|---|
| fromUserJid | String | jid of the typing user | 
| status | TypingStatus | The statusparam will be eithercomposingorgone | 
note
composing means user is typing the message.
gone means user stopped the typing
- Java
- Kotlin
Group chat#
for group chat below callback will be triggered
Callback arguments#
| Argument | Type | Description | 
|---|---|---|
| groupJid | String | jid of the group in which user is typing the message | 
| groupUserJid | String | jid of the typing user | 
| status | TypingStatus | The statusparam will be eithercomposingorgone | 
note
composing means user is typing the message.
gone means user stopped the typing
- Java
- Kotlin
Mute user/Group#
If you want to mute the notifications for the chat of a user or a group, you can utilise the below method.
- Java
- Kotlin
| Argument | Type | Description | 
|---|---|---|
| JID | String | jid of the chat user/ group | 
| MUTE_STATUS | boolean | true, if you want to mute notifications for the chat | 
Get Last seen time of a user#
if you want to get the last seen time for the chat user, you can utilise the below method.
- Java
- Kotlin
| Argument | Type | Description | 
|---|---|---|
| JID | String | jid of the chat user | 
| LISTENER | LastSeenListener | LastSeenListenercallback to observe the action status | 
Note : This method return to the timestamp value 0 means ONLINE otherwise you need to convert to the timestamp value based on your timezone.
Get User/Group profile details#
if you want to get the profile details for the chat user, you can utilise the below method.
- Java
- Kotlin
| Argument | Type | Description | 
|---|---|---|
| JID | String | jid of the user | 
Unread count#
if you want to get the unread count of chat messages, you can utilise the below method.
- Java
- Kotlin
Get Recent Chat#
To get the recent chat of a user or a group.
- Java
- Kotlin
Refer this doc to know more about RecentChat Class
| Arguments | Type | Description | 
|---|---|---|
| JID | String | jid of the user/group | 
caution
Will return a null object if a user never made a conversation with that user/group.
Get Recent Chat list#
To get the recent chat list call the below method.
- Java
- Kotlin
| Argument | Description | Type | 
|---|---|---|
| CALLBACK | FlyCallback | FlyCallbackimplemented as lambda expression | 
info
The method with callback runs on background thread and the one without callback didn't run on background thread
Get Recent Chat list of user by Pagination#
To get the recent chat list as pagination by providing the limit.
Initialization#
First, create a RecentChatListParams instance to set the recent chat list limits based on the inputs.
- Java
- Kotlin
Second, create a RecentChatListBuilder instance. 
- Java
- Kotlin
| Argument | Type | Description | 
|---|---|---|
| RECENT_CHAT_LIST_PARAM | RecentChatListParams | Insatance of 'RecentChatListParams' | 
Load Initial Recent Chat List#
To fetch initial recent chat list of user, call the below method.
- Java
- Kotlin
| Argument | Type | Description | 
|---|---|---|
| CALLBACK | FlyCallback | 'FlyCallback' implemented as lambda expression | 
Load Next Set of Recent Chat List#
To fetch next set of data, call the below method.
- Java
- Kotlin
| Argument | Type | Description | 
|---|---|---|
| CALLBACK | FlyCallback | 'FlyCallback' implemented as lambda expression | 
Get Recent Chat list with archived chats#
To get the recent chat list including the arhived chat conversation call the below method.
- Java
- Kotlin
Delete a Recent Chat#
To delete a recent chat of a user or a group call the method.
- Java
- Kotlin
We can delete a archived recent chat using this method too.
| Arguments | Type | Description | 
|---|---|---|
| JID | String | jid of the user/group | 
caution
Deleting a recent chat will delete the all the conversation for that user/group including favorite messages.
caution
If delete recent chat feature unavailable for your plan then it will throw 403 exception.
Pin a Recent Chat#
To pin a recent chat which makes a particular recent chat to appear at the top of the recent chat list.
- Java
- Kotlin
| Arguments | Type | Description | 
|---|---|---|
| JID | String | jid of the user/group | 
| PIN_RECENT_CHAT | boolean | if truechat will be pinned else the chat will be unpinned | 
Recent Chat Pinned Count#
To get the pinned count on recent chat list call the below method.
- Java
- Kotlin
Clear chat messages#
Clear chat messages is a feature which allows users to delete the chat messages to reduce the storage usage. if you want to clear the messages for the entire chat, or multiple chats then you can utilise the below methods. it will also delete the downloaded media files from your local storage.
Clear chat#
You can clear the messages for any chat by using the below method. The messages will not be deleted to the receipient.
| Argument | Type | Description | 
|---|---|---|
| TO_JID | String | jid of the chat user | 
| CHAT_TYPE | ChatTypeEnum | ChatTypeEnum.chat for single chat, ChatTypeEnum.groupchat for group chat, ChatTypeEnum.broadcast for broadcast | 
| CLEAR_EXCEPT_STARRED | boolean | if true, delete all the messages except the favourite messages | 
| CALLBACK | ChatActionListener | callback to observe the action status | 
- Java
- Kotlin
caution
If clear chat feature unavailable for your plan then it will throw 403 exception.
Delete mulitple conversation#
You can delete the messages of multiple chats including group,brodcast by using the below method.
| Argument | Type | Description | 
|---|---|---|
| JID_LIST | List<String> | List of chat jid whose conversations to be deleted | 
| CALLBACK | ChatActionListener | callback to observe the action status | 
- Java
- Kotlin
caution
If delete chat feature unavailable for your plan then it will throw 403 exception.
Delete all conversation#
You can delete the messages of all chats including group,brodcast by using the below method.
| Argument | Type | Description | 
|---|---|---|
| CALLBACK | ChatActionListener | callback to observe the action status | 
- Java
- Kotlin
caution
If delete chat feature unavailable for your plan then it will throw 403 exception.
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.
- Java
- Kotlin
| Arguments | Type | Description | 
|---|---|---|
| JID_LIST | 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.
- Java
- Kotlin
| Arguments | Type | Description | 
|---|---|---|
| JID_LIST | 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.
Archive/Unarchive Settings#
Archive Chats Permanent status can set by enabling/disabling the option.
- Java
- Kotlin
| Argument | Description | Type | 
|---|---|---|
| BOOLEAN | Boolean | trueto archive the recent chatfalseto unarchive the recent chat | 
Archive Settings Status#
Get Archive Settings Status to keep the archived chats permanent.
- Java
- Kotlin
info
The archived settings status will be returned either True or False
Archive/Unarchive a recent chat conversation#
Archive:#
Archiving a chat conversation makes the chat not appear in recent chat list, mostly used on chats which are inactive for a long time.
UnArchive:#
Unarchiving a archived recent chat conversation makes the chat conversation appear in recent chat list again.
- Java
- Kotlin
| Argument | Description | Type | 
|---|---|---|
| JID | String | jid of the user/group to Archive/UnArchive | 
| BOOLEAN | Boolean | trueto archive the recent chatfalseto unarchive the recent chat | 
Get List of archived recent chat conversation#
An archived chat won't be listed in recent chat list. To get the list of archived chats call the below method.
- Java
- Kotlin
| Argument | Type | Description | 
|---|---|---|
| CALLBACK | FlyCallback | FlyCallbackimplemented as lambda expression | 
info
While user Logging the app, if any chats archived then list will be synced by fetching this method FlyCore.getArchivedChatsFromServer() the list of Archived JIDs will update into FlyCore.getArchivedChatList().   
Search Chat Conversation#
To find a message or similar messages that matches a search term within a chat conversation between two or in a group or among all conversations call the method below.
- Java
- Kotlin
| Argument | Type | Description | Type | 
|---|---|---|---|
| SEARCH_TERM | String | text characters for which search has to happen | |
| JID | String | Unique identifier of a contact/Group (can be empty for global search) | |
| GLOBAL_SEARCH | boolean | if truethen search won't be restricted by jid and search operation executes on every conversation | |
| CALLBACK | FlyCallback | FlyCallbackimplemented as lambda expression | 
caution
Search term can't be empty, for global search pass a empty String as argument for JID.
Message Action Validation#
To get the message actions available for a list of message call the below method.
- Java
- Kotlin
| Argument | Type | Description | 
|---|---|---|
| MESSAGE_ID_LIST | List<String> | list of message ids | 
Forward Messages#
Forwarding feature helps the app users to share the single/multiple messages to one or more users.
Forward messages to single user#
if you want to forward the messages for the chat user, you can utilise the below method.
| Argument | Type | Description | 
|---|---|---|
| MESSAGE_ID_LIST | List<String> | list of message id's | 
| TO_JID | String | jid of the chat user | 
| CHAT_TYPE | ChatTypeEnum | ChatTypeEnum.chat for single chat, ChatTypeEnum.groupchat for group chat, ChatTypeEnum.broadcast for broadcast | 
| CALLBACK | ChatActionListener | callback to observe the action status | 
- Java
- Kotlin
Forward messages to multiple users#
if you want to forward the messages to the multiple users, you can utilise the below method.
| Argument | Type | Description | 
|---|---|---|
| MESSAGE_ID_LIST | List<String> | list of message id's | 
| ROSTER_LIST | List<String> | jid list of the chat users | 
| CALLBACK | ChatActionListener | callback to observe the action status | 
- Java
- Kotlin
Copy Messages#
To copy text messages to the android clipboard call the below method.
- Java
- Kotlin
| Argument | Type | Description | 
|---|---|---|
| MESSAGE_ID_LIST | List<String> | list of message ids | 
info
Only text messages can be copied to clipboard as of now.
Save unsent message#
To save a message which is not sent yet but typed can be saved for each user/group can be done by calling the below method.
- Java
- Kotlin
| Argument | Type | Description | 
|---|---|---|
| JID | String | Jid of the user/group | 
| MESSAGE | String | Text message content | 
Get unsent message of a user/group#
To get the saved unsent message of a user/group call the below method.
- Java
- Kotlin
| Argument | Type | Description | 
|---|---|---|
| JID | String | Jid of the user/group | 
| TEXT_MESSAGE | String | Text message content | 
Save custom value to the message#
To save a custom value to the message which can be saved and mapped for each message can be done by calling the below method.
- Java
- Kotlin
| Argument | Type | Description | 
|---|---|---|
| MESSAGE_ID | String | Unique Id of a ChatMessage | 
| KEY | String | Unique Key for the Value | 
| VALUE | String | Value message content | 
Note : Multiple custom values can be stored to the message with different unique keys.
Get custom value of a message#
To get the custom value of a message call the below method.
- Java
- Kotlin
| Argument | Type | Description | 
|---|---|---|
| MESSAGE_ID | String | Unique Id of a ChatMessage | 
| KEY | String | Unique Key for the Value | 
Remove custom value of a message#
To remove the custom value of a message call the below method.
- Java
- Kotlin
| Argument | Type | Description | 
|---|---|---|
| MESSAGE_ID | String | Unique Id of a ChatMessage | 
| KEY | String | Unique Key for the Value | 
Export chat conversation#
To export a chat conversation of a user, or a group call the below method.
- Java
- Kotlin
| Argument | Type | Description | 
|---|---|---|
| JID | String | jid of the user/group | 
| CALLBACK | FlyCallback | FlyCallbackimplemented as lambda expression | 
Note : To know more about ChatDataModel, refer class documentation.
Email Chat Conversation#
To export a chat conversation of a user, or a group to a list of email recipients call the below method.
- Java
- Kotlin
| Argument | Type | Description | 
|---|---|---|
| JID | String | jid of the user/group | 
| EMAIL_RECIPIENTS_LIST | ArrayList<String> | List of Strings holds the recipients email address. List can be empty but not null. | 
info
Email chat internally call the exportChatConversation() method and presents a share intent to export chat via email
Invite a user#
if you want to invite a user to the chat app, you can utilise the below method.
- Java
- Kotlin
| Argument | Type | Description | 
|---|---|---|
| MOBILE_NUMBER | String | mobile number to send a invite message | 
| MESSAGE | String | invite message content | 
Send Feedback/Contact Us Info#
To send feedback information from the user, you can call the below method.
- Java
- Kotlin
| Argument | Type | Description | 
|---|---|---|
| TITLE | String | title for the feedback | 
| DESCRIPTION | String | detailed info about the feedback | 
| CALLBACK | FlyCallback | FlyCallbackimplemented as lambda expression | 
Backup your chat#
Whenever you need to backup your chat messages, you can use the below method to start backup.
The method will backup all the chats and writes to a file. Once backup completed you can get the
backup file path from the onSuccess callback.
| Argument | Type | Description | 
|---|---|---|
| BACKUP_LISTENER | BackupListener | listener to observe the backup events | 
- Java
- Kotlin
while the backup is running, if you want to cancel the backup you can use the below method
- Java
- Kotlin
Restore from a backup file#
Whenever you need to restore the chat messages from the backup file, you can use the below method.
| Argument | Type | Description | 
|---|---|---|
| BACKUP_FILE | File | backup file | 
| RESTORE_LISTENER | RestoreListener | listener to observe the restore events | 
- Java
- Kotlin
while the restore backup is running, if you want to cancel the restore operation you can use the below method
- Java
- Kotlin
Note: Depending on the chat messages size the above methods may take long time for completion.
info
Cancelling restore operation will lead to partial db data, so avoid cancelling restore operation in most scenarios.
Delete Account#
To delete the chat account call the below method.
- Java
- Kotlin
| Argument | Type | Description | 
|---|---|---|
| REASON | String | reason for the account deletion | 
| FEEDBACK | String | detailed feedback about the account deletion | 
| CALLBACK | FlyCallback | FlyCallbackimplemented as lambda expression | 
info
Deleting chat account will remove all informations(messages, groups and contacts) related to this chat account
Logout of Chat SDK#
To logout of the chat SDK call the below method.
- Java
- Kotlin
| Argument | Type | Description | 
|---|---|---|
| CALLBACK | FlyCallback | FlyCallbackimplemented as lambda expression | 
caution
Once you are logged out you cannot establish a connection with chat server unless you login again.
info
Logout function will not clear messages and groups data in Chat database.
info
Sdk is having a built-in functions to prepare the JID, Group JID.
Get MetaData of user#
If you want to get MetaData value of user, you can utilise the below method.
- Java
- Kotlin
| Argument | Type | Description | 
|---|---|---|
| CALLBACK | FlyCallback | FlyCallbackimplemented as lambda expression | 
Update MetaData of user#
If you want to update MetaData value of user, you can utilise the below method.
- Java
- Kotlin
| Argument | Type | Description | 
|---|---|---|
| META_DATA | List<MetaData> | list of key - value pair of metadata object. Maximum size is 3 | 
| CALLBACK | FlyCallback | FlyCallbackimplemented as lambda expression | 
Chat Tags#
Chat Tags is a feature which allows users to filter the recent chat. if you want to filter your chats by separate titles then you can utilise the below methods.
Create or Update Chat Tag#
You can create or update a chat tag by using the below method.
- Java
- Kotlin
| Argument | Type | Description | 
|---|---|---|
| chatTag | ChatTagModel | ChatTagModel struct holds the chat tag data. | 
| CALLBACK | FlyCallback | FlyCallbackimplemented as lambda expression | 
Get List of Created Chat Tags#
To get a list of created chat tags by using the below method.
- Java
- Kotlin
| Argument | Type | Description | 
|---|---|---|
| isgetFromRecentChatPage | boolean | To get the chatTag data from recent chat or not | 
| CALLBACK | FlyCallback | FlyCallbackimplemented as lambda expression | 
Re-order Chat Tags#
To re-order a chat tags list use the below method.
- Java
- Kotlin
| Argument | Type | Description | 
|---|---|---|
| chatTags | List<ChatTagModel> | list of chatTagModel class | 
| CALLBACK | FlyCallback | FlyCallbackimplemented as lambda expression | 
Delete Chat Tag#
To delete a chat tags use the below method.
- Java
- Kotlin
| Argument | Type | Description | 
|---|---|---|
| deleteTagIdList | ArrayList<String> | ArrayList of chatTagId | 
| CALLBACK | FlyCallback | FlyCallbackimplemented as lambda expression | 
Clear all data in Chat SDK#
To clear all SDK data in the database and preference call the below method.
- Java
- Kotlin
Chat history#
The chat history feature allows us to retrieve chat history every time you log into the newly acquired device. The feature stores chat history securely and provides access to the users whenever they need it. This ensures that users can access the same conversation thread across devices without any data loss.
- Java
- Kotlin

| Argument | Type | Description | Type | 
|---|---|---|---|
| ENABLE_CHAT_HISTORY | boolean | trueTo enable chat history andfalsefor normal chat | 
caution
If the Chat history feature is not available on your plan, the method above will not work.