/ SDKs / iOS
SDKs
Chat SDKs iOS v4
Chat SDKs iOS
Chat SDKs
iOS
Version 4

Retrieve a poll

Copy link

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

let param = PollRetrievalParams()
param.channelType = channel.channelType
param.channelURL = channel.channelURL
param.pollId = poll.pollId

Poll.get(params: param) { poll, error in
    
}

PollRetrievalParams

Copy link
Parameter nameTypeDescription

channelUrl

string

Specifies the URL of the channel.

channelType

channelType

Specifies the type of the channel.

pollId

Int64

Specifies the unique ID of a poll.

PollHandler

Copy link

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

public typealias PollHandler = (_ poll: Poll?, _ error: SBError?) -> Void