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

Retrieve a poll option

Copy link

You can retrieve a specific poll option by creating and passing a PollOptionRetrievalParams object as an argument to the PollOption.get() method.

KotlinKTX
val params = PollOptionRetrievalParams(pollId, pollOptionId, channel.channelType, channel.url)
PollOption.get(params) { option, e ->
    if (e != null) {
        // Handle error.
    }

    // The poll option has been successfully retrieved.
}

List of properties for poll option

Copy link
Property nameTypeDescription

pollId

long

Specifies the unique ID of a poll.

id

long

Specifies the unique ID of a poll option. This value is unique within a poll.

text

string

Specifies the text that describes an option.

createdBy

string

Specifies the unique ID of the user who created an option.

createdAt

long

Specifies the time when an option is created in Unix seconds.

voteCount

long

Specifies the number of votes casted on an option.

updatedAt

long

Specifies the time when an option is updated in Unix seconds.

PollOptionRetrievalParams

Copy link
Parameter nameTypeDescription

pollId

long

Specifies the unique ID of a poll.

pollOptionId

long

Specifies the unique ID of a poll option.

channelType

channelType

Specifies the type of the channel.

channelUrl

string

Specifies the URL of the channel.

PollOptionHandler

Copy link

Through PollOptionHandler, the Sendbird server always notifies whether your poll option has been successfully retrieved.

fun interface PollOptionHandler {
    fun onResult(pollOption: PollOption?, e: SendbirdException?)
}