Skip to main content

Submit Poll Vote

The SubmitPollVoteRequest function creates request to submit votes for a poll within the Feed SDK.

Steps to submit a poll vote

  1. Create a SubmitPollVoteRequest object using the SubmitPollVoteRequest.builder() method.
  2. Call submitPoll() function using the instance of LMFeedClient.
  3. 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

PropertyTypeDescriptionOptional
pollIDStringThe unique identifier of the poll
votes[String]An array of selected option identifiers