getConversation method
Get a conversation by its UUID.
It's possible if:
- the user that calls the method is/was a participant of this conversation
- the conversation is an available public conversation (see VIMessenger.getPublicConversations)
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);
}
}