Retrieve Messages
Get a message#
Whenever you get callbacks from MessageEventsListeners, you will get messageId sometimes at those times you can fetch the message from db using the below method and then update your list as well as notify the list view.
- Dart
- Response
Argument | Type | Description |
---|---|---|
MESSAGE_ID | String | messageId of the message |
Get messages using id's#
To get list of messages from a given message id's call the below method.
- Dart
- Response
Get messages of a user/group#
To fetch all the conversation between you and a single chat user or group, call the below method.
- Dart
- Response
Argument | Type | Description |
---|---|---|
JID | String | Jid of the user/group |
Get messages of a user/group via pagination#
Initialization#
First, create a FetchMessageListParams
instance. Here, you need to set the message filter to determine the message order and the starting point of the message list in the chat view.
Argument | Type | Description |
---|---|---|
JID | String | Jid of the user/group |
MESSAGE_ID | String | Message id of the starting point optional |
MESSAGE_TIME | String | Message time of the starting point optional |
EXCULDE | boolean | If true starting point message will be excluded in message list default true |
ASCENDING_ORDER | boolean | 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 25 |
TOPIC_ID | String | Topic Id to be fetched |
Load Initial Messages#
To fetch initial conversations between you and a single chat user or group using pagination, call the below method.
- Dart
- Response
Argument | Type | Description |
---|---|---|
flyCallback | FlyResponse | callback to observe the action status |
Load Previous Messages#
To fetch previous conversations between you and a single chat user or group, call the below method.
- Dart
- Response
Argument | Type | Description |
---|---|---|
flyCallback | FlyResponse | callback to observe the action status |
Load Next Messages#
To fetch next conversations between you and a single chat user or group, call the below method.
- Dart
- Response
Argument | Type | Description |
---|---|---|
flyCallback | FlyResponse | callback to observe the action status |
Check Previous Set of Messages Available or not#
To check previous set of conversations available or not, call the below method.
Check Next Set of Messages Available#
To check next set of conversations available or not, call the below method.
Get media messages#
If you want to get the media messages for a user/group, you can utilise the below method.
- Dart
- Response
Argument | Type | Description |
---|---|---|
JID | String | jid of the chat user |
info
Above methods fetch media messages which are successfully sent and received.
caution
If media message feature unavailable for your plan then it will throw 403 exception.
To get the uploaded/downloaded status of a media message Refer the snippet below.
For received media message:
For sent media message:
Argument | Type | Description |
---|---|---|
MEDIA_MESSAGE_ID | String | id of a message |
Get document messages#
If you want to get the Document messages for a user/group, you can utilise the below method.
- Dart
- Response
Argument | Type | Description |
---|---|---|
JID | String | jid of the chat user |
info
Above methods fetch document messages which are successfully sent and received.
caution
If media message feature unavailable for your plan then it will throw 403 exception.
Get link messages#
If you want to get the link messages for a user/group, you can utilise the below method.
- Dart
- Response
Argument | Type | Description |
---|---|---|
JID | String | jid of the chat user |
info
Above methods fetch link messages which are successfully sent and received.
Unread count#
if you want to get the unread count of chat messages except muted chat, you can utilise the below method.