Skip to main content

Add Poll Options

The AddPollOptions function allows uses to add a new option to an existing poll.

Steps to add a poll option

  1. Create an AddPollOptionRequest object using the AddPollOptionRequest.builder() method.
  2. Call addPollOption() function using the instance of LMFeedClient.
  3. Process the response LMResponse<AddPollOptionResponse> as per your requirement.
let request = AddPollOptionRequest.builder()
.pollID("Enter Poll ID")
.pollText("New option")
.build()

LMFeedClient.shared.addPollOption(request) { response in
// Response (LMResponse<AddPollOptionResponse>)
if (response.success) {
// your function to process the response data
processResponse(response.data)
} else {
// your function to process error message
processError(response.errorMessage)
}
}

Models

AddPollOptionRequest

PropertyTypeDescriptionRequired
pollIDStringThe unique identifier of the pollYes
pollTextStringThe text of the new poll optionYes

AddPollOptionResponse

PropertyTypeDescriptionOptional
widgetWidget?The updated widget after adding the new poll option