Chat / iOS
Chat iOS v4
Chat iOS
Chat
iOS
Home
/
Chat
/
iOS
/
Message
This is the new Docs for Chat SDK v4 for iOS. To see the previous Docs, click here.

Retrieve a poll option

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

let param = PollOptionRetrievalParams()
param.pollId = poll.pollId
param.pollOptionId = poll.firstOptionId
param.channelURL = channel.channelURL
param.channelType = channel.channelType

PollOption.getPollOption(params: param) { option, error in
    
}

List of properties for poll option

Property nameTypeDescription

pollId

Int64

Specifies the unique ID of a poll.

id

Int64

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

Int64

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

voteCount

Int64

Specifies the number of votes casted on an option.

updatedAt

Int64

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

PollOptionRetrievalParams

Parameter nameTypeDescription

pollId

Int64

Specifies the unique ID of a poll.

pollOptionId

Int64

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

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

public typealias PollOptionHandler = (_ option: PollOption?, _ error: SBError?) -> Void