getUnreadMessageCount method

Future<int> getUnreadMessageCount()

Gets the count of the unread messages.

Return The count of the unread messages.

Throws A description of the exception. See ChatError.


Future<int> getUnreadMessageCount() async {
  Map result =
      await ChatChannel.invokeMethod(ChatMethodKeys.getUnreadMessageCount);
  try {
    int ret = 0;
    if (result.containsKey(ChatMethodKeys.getUnreadMessageCount)) {
      ret = result[ChatMethodKeys.getUnreadMessageCount] as int;
    return ret;
  } on ChatError catch (e) {
    throw e;