Retrieve Messages
#
Get a messageWhenever you get callbacks from MessageEventsListener, 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.
- Java
- Kotlin
Argument | Type | Description |
---|---|---|
MESSAGE_ID | String | messageId of the message |
#
Get messages using id'sTo get list of messages from a given message id's call the below method.
- Java
- Kotlin
#
Get messages of a user/groupTo fetch all the conversation between you and a single chat user or group, call the below method.
- Java
- Kotlin
Argument | Type | Description |
---|---|---|
JID | String | Jid of the user/group |
#
Get messages of a user/group via pagination#
InitializationFirst, 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.
- Java
- Kotlin
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 |
INCLUSIVE | boolean | If true starting point message will included in message list default false |
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 50 |
TOPIC_ID | String | Topic Id to be fetched |
Second, create a FetchMessageListQuery
instance.
- Java
- Kotlin
Argument | Type | Description |
---|---|---|
MESSAGE_LIST_PARAM | FetchMessageListParams | Insatance of 'FetchMessageListParams' |
#
Load Initial MessagesTo fetch initial conversations between you and a single chat user or group, call the below method.
- Java
- Kotlin
Argument | Type | Description |
---|---|---|
CALLBACK | FlyCallback | 'FlyCallback' implemented as lambda expression |
#
Load Previous MessagesTo fetch previous conversations between you and a single chat user or group, call the below method.
- Java
- Kotlin
Argument | Type | Description |
---|---|---|
CALLBACK | FlyCallback | 'FlyCallback' implemented as lambda expression |
#
Load Next MessagesTo fetch next conversations between you and a single chat user or group, call the below method.
- Java
- Kotlin
Argument | Type | Description |
---|---|---|
CALLBACK | FlyCallback | 'FlyCallback' implemented as lambda expression |
#
Check Previous Set of Messages Available or notTo check previous set of conversations available or not, call the below method.
- Java
- Kotlin
#
Check Next Set of Messages AvailableTo check next set of conversations available or not, call the below method.
- Java
- Kotlin
#
Check Message Fetching InProgressTo check conversations fetching in progress or not, call the below method.
- Java
- Kotlin
#
Get media messagesIf you want to get the media messages for a user/group, you can utilise the below method.
- Java
- Kotlin
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:
- Java
- Kotlin
For sent media message:
- Java
- Kotlin
Argument | Type | Description |
---|---|---|
MEDIA_MESSAGE_ID | String | id of a message |
#
Get recalled messages of a user/groupTo get the recalled messages of a user/group call the below method.
- Java
- Kotlin
Argument | Type | Description |
---|---|---|
JID | String | Jid of the user/group |