Other chat features
#
Report User/Group MessagesThis 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_MID
is 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 chat or group 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/GroupThis 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 StatusThis 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 StatusThis 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 statusYou 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 statusTo 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 chatfor single chat below callback will be triggered
#
Callback argumentsArgument | Type | Description |
---|---|---|
fromUserJid | String | jid of the typing user |
status | TypingStatus | The status param will be either composing or gone |
note
composing
means user is typing the message.
gone
means user stopped the typing
- Java
- Kotlin
#
Group chatfor group chat below callback will be triggered
#
Callback argumentsArgument | 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 status param will be either composing or gone |
note
composing
means user is typing the message.
gone
means user stopped the typing
- Java
- Kotlin
#
Mute user/GroupIf 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 userif 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 | LastSeenListener callback 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.
#
Check hide last seen statusTo check whether last seen status is available to friends or not, call the below method.
- Java
- Kotlin
#
Get User/Group profile detailsif 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 countif you want to get the unread count of chat messages, you can utilise the below method.
- Java
- Kotlin
#
Get Recent ChatTo 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 listTo get the recent chat list call the below method.
- Java
- Kotlin
Argument | Description | Type |
---|---|---|
CALLBACK | FlyCallback | FlyCallback implemented 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 PaginationTo 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 ListTo 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 ListTo 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 chatsTo get the recent chat list including the arhived chat conversation call the below method.
- Java
- Kotlin
#
Delete a Recent ChatTo 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 ChatTo 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 true chat will be pinned else the chat will be unpinned |
#
Recent Chat Pinned CountTo get the pinned count on recent chat list call the below method.
- Java
- Kotlin
#
Clear chat messagesClear 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 chatYou 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 conversationYou 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 conversationYou 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 readBy 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 unreadBy 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 SettingsArchive Chats Permanent status can set by enabling/disabling the option.
- Java
- Kotlin
Argument | Description | Type |
---|---|---|
BOOLEAN | Boolean | true to archive the recent chat false to unarchive the recent chat |
#
Archive Settings StatusGet 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 | true to archive the recent chat false to unarchive the recent chat |
#
Get List of archived recent chat conversationAn 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 | FlyCallback implemented 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 ConversationTo 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 true then search won't be restricted by jid and search operation executes on every conversation | |
CALLBACK | FlyCallback | FlyCallback implemented as lambda expression |
caution
Search term can't be empty, for global search pass a empty String as argument for JID.
#
Message Action ValidationTo 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 MessagesForwarding feature helps the app users to share the single/multiple messages to one or more users.
#
Forward messages to single userif 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 usersif 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<Roster> | jid list of the chat users |
CALLBACK | ChatActionListener | callback to observe the action status |
- Java
- Kotlin
#
Copy MessagesTo 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 messageTo 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/groupTo 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 messageTo 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 messageTo 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 messageTo 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 conversationTo 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 | FlyCallback implemented as lambda expression |
Note : To know more about ChatDataModel, refer class documentation.
#
Email Chat ConversationTo 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 userif 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 InfoTo 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 | FlyCallback implemented as lambda expression |
#
Backup your chatWhenever 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 fileWhenever 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 AccountTo 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 | FlyCallback implemented as lambda expression |
info
Deleting chat account will remove all informations(messages, groups and contacts) related to this chat account
#
Logout of Chat SDKTo logout of the chat SDK call the below method.
- Java
- Kotlin
Argument | Type | Description |
---|---|---|
CALLBACK | FlyCallback | FlyCallback implemented 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.
#
Clear all data in Chat SDKTo clear all SDK data in the database and preference call the below method.
- Java
- Kotlin