typing method

Inform the cloud that the user is typing some text.

The method calls within 10s interval from the last call cause VIException.

If the sequence parameter specified less than 1, the method will mark all the events as unread (for this participant) except the event with the sequence equals to '1'.

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

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

Implementation

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