Chat / iOS
Chat iOS v4
Chat iOS
Chat
iOS
Home
/
Chat
/
iOS
/
Message
This is the new Docs for Chat SDK v4 for iOS. To see the previous Docs, click here.

List changelogs of messages

Each message changelog has distinct properties such as the timestamp of an updated message or the unique ID of a deleted message. Based on the following two properties, you can retrieve message changelogs using either the timestamp or the token. Both the getMessageChangeLogs(timestamp:params:completionHandler:) and getMessageChangeLogs(token:params:completionHandler: methods require a MessageChangeLogsParams object to determine what messages to return.

let params = MessageChangeLogsParams()
params.replyType = REPLY_TYPE
params.includeThreadInfo = INCLUDE_THREAD_INFO
params.includeParentMessageInfo = INCLUDE_PARENT_MESSAGE_INFO

MessageChangeLogsParams

Property nameTypeDescription

replyType

ReplyType

Specifies the type of message to include in the results.
- .none (default): Includes unthreaded messages and only the parent messages of threaded messages.
- .all: Includes both threaded and unthreaded messages.
- .onlyReplyToChannel: Includes unthreaded messages, parent messages of threaded messages, and messages sent to the channel as replies with the reply_to_channel property set to true.

includeThreadInfo

Bool

Determines whether to include the thread information of the messages in the result. (Default: false)

includeParentMessageInfo

Bool

Determines whether to include the information of the parent message in the result. (Default: false)


By timestamp

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

channel.getMessageChangeLogs(timestamp: TIMESTAMP, params: params) { (updatedMessages, deletedMessageIds, hasMore, token, error) in
    guard error == nil else {
        // Handle error.
        return
    }

    // A list of message changelogs created after the specified timestamp is successfully retrieved.
}

List of parameters

Parameter nameTypeDescription

timestamp

Int64

Specifies the timestamp to be the reference point for retrieving changelogs in Unix milliseconds format.

params

MessageChangeLogsParams

Contains a set of parameters you can use when retrieving changelogs.


By token

You can also retrieve message 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 will start with changelogs that were created after the specified token.

channel.getMessageChangeLogs(token: TOKEN, params: params) { updatedMessages, deletedMessageIds, hasMore, token, error in
    guard error == nil else {
        // Handle error.
        return
    }

    // A list of message changelogs created after the specified token is successfully retrieved.
})

List of parameters

Parameter nameTypeDescription

token

string

Specifies the token to be the reference point for retrieving changelogs.

params

MessageChangeLogsParams

Contains a set of parameters you can use when retrieving changelogs.