getUnreadMessageCount method
Gets the count of the unread messages.
Return The count of the unread messages.
Throws A description of the exception. See ChatError.
Implementation
Future<int> getUnreadMessageCount() async {
Map result =
await ChatChannel.invokeMethod(ChatMethodKeys.getUnreadMessageCount);
try {
int ret = 0;
ChatError.hasErrorFromResult(result);
if (result.containsKey(ChatMethodKeys.getUnreadMessageCount)) {
ret = result[ChatMethodKeys.getUnreadMessageCount] as int;
}
return ret;
} on ChatError catch (e) {
throw e;
}
}