joinConversation method

Future<VIConversationEvent> joinConversation(
  1. String uuid
)

Join the current user to any conversation specified by the UUID.

It's possible only on the following conditions:

Other parties of the conversation (online participants and logged in clients) can be informed about joining to the conversation via the VIMessenger.onEditConversation callback.

uuid - Conversation UUID

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

Implementation

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