getConversation method

Future<VIConversationEvent> getConversation(
  1. String uuid
)

Get a conversation by its UUID.

It's possible if:

uuid - Conversation UUID

Throws VIException, if operation failed, otherwise returns VIConversationEvent instance. For all possible errors see VIMessagingError

Implementation

Future<VIConversationEvent> getConversation(String uuid) async {
  try {
    Map<String, dynamic>? data = await _methodChannel
        .invokeMapMethod('Messaging.getConversation', {'uuid': uuid});
    if (data == null) {
      _VILog._e('VIMessenger: getConversation: data was null, skipping');
      throw VIException(
        VIMessagingError.ERROR_INTERNAL,
        'VIMessenger:getConversation: data was null',
      );
    }
    return VIConversationEvent._fromMap(data);
  } on PlatformException catch (e) {
    throw VIException(e.code, e.message);
  }
}