setLastReadMessageIndex method

Future<int?> setLastReadMessageIndex(
  1. int lastReadMessageIndex
)

Set the last read index for this Participant and Conversation. Allows you to set any value, including smaller than the current index.

Returns an updated unread message count for the user on this conversation.

Implementation

Future<int?> setLastReadMessageIndex(int lastReadMessageIndex) async {
  try {
    final result = await TwilioConversations()
        .conversationApi
        .setLastReadMessageIndex(sid, lastReadMessageIndex);
    return result.count;
  } on PlatformException catch (err) {
    throw TwilioConversations.convertException(err);
  }
}