Add Poll Options
The AddPollOptions function allows uses to add a new option to an existing poll.
Steps to add a poll option
- Create an
AddPollOptionRequestobject using theAddPollOptionRequest.builder()method. - Call
addPollOption()function using the instance ofLMFeedClient. - 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
| Property | Type | Description | Required |
|---|---|---|---|
pollID | String | The unique identifier of the poll | Yes |
pollText | String | The text of the new poll option | Yes |
AddPollOptionResponse
| Property | Type | Description | Optional |
|---|---|---|---|
widget | Widget? | The updated widget after adding the new poll option | ✔ |