/ SDKs / iOS
SDKs
Chat SDKs iOS v4
Chat SDKs iOS
Chat SDKs
iOS
Version 4

List changelogs of polls

Copy link

Each poll changelog has distinct properties such as the timestamp of an updated poll or the unique ID of a deleted poll. Based on these two properties, you can retrieve poll changelogs using either the timestamp or the token.


By timestamp

Copy link

You can retrieve the poll changelogs by specifying a timestamp. The results only include changelogs that were created after the specified timestamp.

    channel.getPollChangeLogs(timestamp: timestamp) { updatedPolls, deletedPollIds, hasMore, token, error in
        // A list of poll changelogs created after the specified timestamp is successfully retrieved.
    }

List of parameters

Copy link
Parameter nameTypeDescription

timestamp

Int64

Specifies a timestamp to be the reference point for the changelogs to be retrieved, in Unix milliseconds format.


By token

Copy link

You can also retrieve poll changelogs by specifying a token. The token is an opaque string that marks the starting point of the next page in the result set and it's included in the callback of the previous call. Based on the token, the next page starts with changelogs that were created after the specified token.

    channel.getPollChangeLogs(token: token, timestamp: timestamp) { updatedPolls, deletedPollIds, hasMore, token, error in
        // A list of poll changelogs created after the specified token is successfully retrieved.
    }

List of parameters

Copy link
Parameter nameTypeDescription

token

String?

Specifies a token to be the reference point for the changelogs to be retrieved.

PollChangeLogsHandler

Copy link

Through PollChangeLogsHandler, the Sendbird server always notifies whether your poll option has been successfully added.

public typealias PollChangeLogsHandler = ((_ updatedPolls: [Poll]?,
                                           _ deletedPollIds: [Int64]?,
                                           _ hasMore: Bool,
                                           _ token: String?,
                                           _ error: SBError?) -> Void)