Retrieve Messages
Get messages using ids#
To get array of messages from database using their message ids, call the below method.
| Argument | Type | Description |
|---|---|---|
| MESSAGE_MIDS | [String] | Ids of messages |
Get messages of a user/group#
To fetch all the conversation between you and a single chat user or group, call the below method.
| Argument | Type | Description |
|---|---|---|
| JID | String | Jid of the chat user/group |
Get messages by pagination#
Initialization#
Create a FetchMessageListParams instance. Here, you can set the message filter to determine the message order and the starting point of the message list in the chat view.
| Argument | Type | Description |
|---|---|---|
| CHAT_ID | String | Jid of the user/group |
| MESSAGE_ID | String | Message id of the starting point optional |
| MESSAGE_TIME | Double | Message time of the starting point optional |
| EXCLUDE | Bool | If true starting point message will be excluded in message list default true |
| ASCENDING_ORDER | Bool | If true message list will be returned ascendingOrder by message time default false |
| LIMIT | Int | No of messages will be fetched for each request default 50 |
| TOPIC_ID | String | Topic ID to be fetched` |
Secondly, create a FetchMessageListQuery instance.
| Argument | Type | Description |
|---|---|---|
| MESSAGE_LIST_PARAM | FetchMessageListParams | 'Insatance of 'FetchMessageListParams' |
Load Initial Messages#
To fetch initial conversations between you and a single chat user or group, call the below method.
| Argument | Type | Description |
|---|---|---|
| CALLBACK | FlyCompletionHandler | FlyCompletionHandler implemented as closures |
Load Previous Messages#
To fetch previous conversations between you and a single chat user or group, call the below method.
| Argument | Type | Description |
|---|---|---|
| CALLBACK | FlyCompletionHandler | FlyCompletionHandler implemented as closures |
Load Next Messages#
To fetch next conversations between you and a single chat user or group, call the below method.
| Argument | Type | Description |
|---|---|---|
| CALLBACK | FlyCompletionHandler | FlyCompletionHandler implemented as closures |
Check Previous Set of Messages availability#
To check previous set of conversations available or not, call the below method.
Check Next Set of Messages availability#
To check next set of conversations available or not, call the below method.
Check Message Fetching InProgress#
To check conversations fetching in progress or not, call the below method.
Get media messages#
To get the media messages of a conversation, call the below method.
| Argument | Type | Description |
|---|---|---|
| JID | String | Jid of the chat user/group |
To get Video, Image, and Audio messages a conversation, call the below method. It is used in view all media to get array of messages group by month
| Argument | Type | Description |
|---|---|---|
| jid | String | jid of the chat user/group |
Unread count#
if you want to get the unread count of chat messages, you can utilise the below method.