advanceLastReadMessageIndex method

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

Update the last read index for this Participant and Conversation. Only update the index if the value specified is larger than the previous value.

Note: It appears that the constraint is only enforced on Android, not iOS.

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

Implementation

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