/ SDKs / Android
SDKs
Chat SDKs Android v4
Chat SDKs Android
Chat SDKs
Android
Version 4

Retrieve the total number of scheduled messages

Copy link

Use the getTotalScheduledMessageCount() method to retrieve the total number of scheduled messages a user has. The properties of TotalScheduledMessageCountParams are optional to set as a filter. If not set, the number of all scheduled messages that a user has will be retrieved.

KotlinKTX
// Retrieves the total number of scheduled messages.
val params = TotalScheduledMessageCountParams(
    channelUrl = null,
    scheduledStatus = null,
    messageTypeFilter = MessageTypeFilter.ALL
)
SendbirdChat.getTotalScheduledMessageCount(params) { count, e ->
    if (e != null) {
        // Handle error.
    }

    // `count` contains the number of scheduled messages.
}

TotalScheduledMessageCountParams

Copy link
Parameter nameTypeDescription

channelUrl

string

Specifies the URL of the channel. (Default: null)

scheduledStatus

list

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

messageTypeFilter

enum

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