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.
Note : In this method
messageIdis optional argument. If person selected a message to report use this param other wise ignore the param.
| Argument | Type | Description | 
|---|---|---|
| jid | string | Report User Jid who needs to be reported | 
| type | string | User chat type either chat or groupchat | 
| messageId | string | Selected Message ID | 
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.
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.
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 | 
|---|---|---|
| toJid | String | jid of the chat user | 
| chatType | String | chat type either chat or groupchat | 
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.
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.
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 | 
|---|---|
| singleOrgroupJid | String | 
| userJid | String | 
| status | String | 
note
composing means user is typing the message.
Gone means user stopped the typing
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.
| Argument | Type | Description | 
|---|---|---|
| jid | String | jid of the chat user/ group | 
| muteStatus | 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.
| Argument | Type | Description | 
|---|---|---|
| JID | String | jid of the chat user | 
Check hide last seen status#
To check whether last seen status is available to friends or not, call the below method.
Get User/Group profile details#
if you want to get the profile details for the chat user, you can utilise the below method.
| Argument | Type | Description | 
|---|---|---|
| jid | String | jid of the user | 
| fetchFromServer | bool | if true fetches data from the server else fetches data from local database | 
Get Recent Chat#
To get the recent chat of a user or a group.
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.
Get Recent Chat list of user by Pagination#
To get the recent chat list as pagination by providing the limit.
| Arguments | Type | Description | 
|---|---|---|
| firstSet | bool | set true to get initial recent chat list otherwise get next set of data | 
| limit | int | The maximum number of chat items to retrieve is specified by limit with a default value of 15 if not provided. | 
Get Recent Chat list with archived chats#
To get the recent chat list including the arhived chat conversation call the below method.
Delete a Recent Chat#
To delete a recent chat of a user or a group call the method.
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.
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.
| Arguments | Type | Description | 
|---|---|---|
| jid | String | jid of the user/group | 
| pinStatus | boolean | if true chat 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.
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 | 
|---|---|---|
| jid | String | jid of the chat user | 
| chatType | String | chat for single chat, groupchat for group chat | 
| clearExceptStarred | bool | if true, delete all the messages except the favourite messages | 
Delete mulitple conversation#
You can delete the messages of multiple chats including group,brodcast by using the below method.
| Argument | Type | Description | 
|---|---|---|
| jidlist | List<String> | List of chat jid whose conversations to be deleted | 
Delete all conversation#
You can delete the messages of all chats including group,brodcast by using the below method.
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.
| Arguments | Type | Description | 
|---|---|---|
| jidlist | 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.
| Arguments | Type | Description | 
|---|---|---|
| jidlist | 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.
| Argument | Type | Description | 
|---|---|---|
| enable | Boolean | true to archive the recent chat false to unarchive the recent chat | 
Archive Settings Status#
Get Archive Settings Status to keep the archived chats permanent.
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.
| Argument | Description | Type | 
|---|---|---|
| jid | String | jid of the user/group to Archive/UnArchive | 
| isArchived | Boolean | true to archive the recent chat false to 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.
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.
| Argument | Type | Description | Type | 
|---|---|---|---|
| searchKey | String | text characters for which search has to happen | |
| jidForSearch | String | Unique identifier of a contact/Group (can be null for global search) | |
| globalSearch | bool | if true then search won't be restricted by jid and search operation executes on every conversation (default value true) | 
Forward Messages#
Forwarding feature helps the app users to share the single/multiple messages to one or more users.
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 | 
|---|---|---|
| messageIds | List<String> | list of message id's | 
| userList | List<String> | jid list of the chat users | 
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.
| 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.
| Argument | Type | Description | 
|---|---|---|
| jid | String | Jid of the user/group | 
Export chat conversation#
To export a chat conversation of a user, or a group call the below method.
| Argument | Type | Description | 
|---|---|---|
| JID | String | jid of the user/group | 
Send Feedback/Contact Us Info#
To send feedback information from the user, you can call the below method.
| Argument | Type | Description | 
|---|---|---|
| title | String | title for the feedback | 
| description | String | detailed info about the feedback | 
Delete Account#
To delete the chat account call the below method.
| Argument | Type | Description | 
|---|---|---|
| reason | String | reason for the account deletion | 
| feedback | String | detailed feedback about the account deletion | 
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.
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.