Submit Poll Vote
The SubmitPollVoteRequest
function creates request to submit votes for a poll within the Feed SDK.
Steps to submit a poll vote
- Create a
SubmitPollVoteRequest
object using theSubmitPollVoteRequest.builder()
method. - Call
submitPoll()
function using the instance ofLMFeedClient
. - Process the response LMResponse<[NoData]> as per your requirement.
let request = SubmitPollVoteRequest.builder()
.pollID("Enter Poll ID")
.votes(["option1", "option2"])
.build()
LMFeedClient.shared.submitPoll(request) { response in
// Response (LMResponse<NoData>)
if (response.success) {
// your function to process the response data
processResponse(response.data)
} else {
// your function to process error message
processError(response.errorMessage)
}
}
Models
SubmitPollVoteRequest
Property | Type | Description | Optional |
---|---|---|---|
pollID | String | The unique identifier of the poll | ✔ |
votes | [String] | An array of selected option identifiers |