/ SDKs / Flutter
SDKs
Chat SDKs Flutter v4
Chat SDKs Flutter
Chat SDKs
Flutter
Version 4

List changelogs of messages

Copy link

Each message changelog has distinct properties such as the timestamp of an updated message or the unique ID of a deleted message. Based on these two properties, you can retrieve message changelogs using either the timestamp or the token. The getMessageChangeLogs() method require a MessageChangeLogsParams object as their parameter to determine which messages to return.

MessageChangeLogsParams

Copy link
Property nameTypeDescription

includeMetaArray

bool

Determines whether to include the message's meta-array information in the results. (Default: false)

includeReactions

bool

Determines whether to include the message reactions in the results. (Default: false)

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 messages in the result. (Default: false)

replyType

ReplyType?

Specifies the type of message to include in the results.
- none: 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.


By timestamp

Copy link

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

try {
  final params = MessageChangeLogParams()
    ..replyType = ReplyType.none
    ..includeParentMessageInfo = true;

  final messageChangeLogs = await channel.getMessageChangeLogs(
    params,
    timestamp: timestamp,
  );
} catch (e) {
  // Handle error.
}

List of parameters

Copy link
Parameter nameTypeDescription

params

MessageChangeLogsParams

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

timestamp

int?

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 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 starts with changelogs that were created after the specified token.

try {
  final params = MessageChangeLogParams()
    ..replyType = ReplyType.none
    ..includeParentMessageInfo = true;

  final messageChangeLogs = await channel.getMessageChangeLogs(
    params,
    token: 'TOKEN',
  );
} catch (e) {
  // Handle error.
}

List of parameters

Copy link
Parameter nameTypeDescription

params

MessageChangeLogsParams

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

token

String?

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