Chat / Android
Chat Android v4
Chat Android
Chat
Android
Version 4
Home
/
Chat
/
Android
/
Message

List all scheduled messages

Create a ScheduleMessageListQuery instance to retrieve all scheduled messages matching the specifications set by ScheduledMessageListQueryParams. After a list of all scheduled messages is successfully retrieved, you can access the data of each scheduled message from the result list through the messageList parameter of the callback handler.

val params = ScheduledMessageListQueryParams(
    order = ScheduledMessageListQuery.Order.CREATED_AT,
    messageTypeFilter = MessageTypeFilter.ALL,
    reverse = false,
    channelUrl = null,
    scheduledStatus = null,
    limit = 20
)

val query = SendbirdChat.createScheduledMessageListQuery(params)
query.next { messageList, e ->
    if (e != null) {
        // Handle error.
    }
    // You can handle actions relevant to the scheduled message list of the channel.
}

ScheduledMessageListQueryParams

Property nameTypeDescription

order

enum

Determines the order of the retrieved messages. Acceptable values are CREATED_AT and SCHEDULED_AT. (Default: CREATED_AT)

messageTypeFilter

enum

Specifies the message type to filter the messages with the corresponding type. Acceptable values are ALL, USER, FILE, and ADMIN. (Default: ALL)

reverse

boolean

Determines whether to sort the retrieved messages in reverse order. If false, the results are in ascending order. (Default: false)

channelUrl

string

Specifies a target channel to query the scheduled messages from. If null, it retrieves scheduled messages from all channels. (Default: null)

scheduledStatus

list

Specifies list of ScheduledStatus where scheduled messages with only given ScheduledStatus are retrieved. (Default: null)

limit

int

Specifies the number of results to return per call. Acceptable values are 1 to 100, inclusive. (Default: 20)