SBDPoll Class Reference

Inherits from NSObject
Conforms to NSCopying
SBDMappable
Declared in SBDPoll.h

Overview

Represents a poll that users can vote

  pollId

Poll id

@property (atomic, assign, readonly) long long pollId

Declared In

SBDPoll.h

  title

Title of this poll

@property (nonatomic, strong, readonly) NSString *title

Declared In

SBDPoll.h

  details

Detail information of this poll

@property (nonatomic, strong, readonly, nullable) SBDPollDetails *details

Discussion

Note: this property can be nil if includePollDetails option is NO when fetching message list

Declared In

SBDPoll.h

– init

- (nonnull instancetype)init

+ createWithParams:completionHandler:

Creates a poll with given params

+ (void)createWithParams:(SBDPollParams *)params completionHandler:(SBDPollHandler)completionHandler

Parameters

completionHandler

completion block

Declared In

SBDPoll.h

+ getWithParams:completionHandler:

Gets a poll

+ (void)getWithParams:(SBDPollRetrievalParams *)params completionHandler:(SBDPollHandler)completionHandler

Parameters

params

SBDPollRetrievalParams object

completionHandler

completion block

Declared In

SBDPoll.h

– updateWithParams:completionHandler:

Updates this poll with params

- (void)updateWithParams:(SBDPollParams *)params completionHandler:(SBDPollHandler)completionHandler

Parameters

params

SBDPollParams object to update the poll

completionHandler

completion block

Declared In

SBDPoll.h

– closeWithCompletionHandler:

Closes this poll

- (void)closeWithCompletionHandler:(SBDPollHandler)completionHandler

Parameters

completionHandler

completion block

Declared In

SBDPoll.h

– deleteWithCompletionHandler:

Deletes this poll

- (void)deleteWithCompletionHandler:(nullable SBDErrorHandler)completionHandler

Parameters

completionHandler

completion block

Declared In

SBDPoll.h

– addOptionWithText:channelUrl:completionHandler:

Adds an option to this poll

- (void)addOptionWithText:(NSString *)text channelUrl:(NSString *)channelUrl completionHandler:(SBDPollHandler)completionHandler

Parameters

text

option text

channelUrl

channel url where this poll is included

completionHandler

completion block

Declared In

SBDPoll.h

– voteWithOptionIds:channelUrl:completionHandler:

Votes on this poll

- (void)voteWithOptionIds:(NSArray<NSNumber*> *)optionIds channelUrl:(NSString *)channelUrl completionHandler:(SBDPollHandler)completionHandler

Parameters

optionIds

number array that contains option ids

completionHandler

completion block

Declared In

SBDPoll.h