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

Add a poll option

You can add a poll option to an existing poll by passing the pollId and the optionText as an argument to the parameter in the addPollOption() method.

channel.addPollOption(pollId, "optionText") { poll, e ->
    if (e != null) {
        // Handle error.
    }
    
    if (poll != null) {
        
    }
}

PollHandler

Through PollHandler, the Sendbird server always notifies whether your poll option has been successfully added.

fun interface PollHandler {
    fun onResult(poll: Poll?, e: SendbirdException?)
}