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 {
try {
Map result = await platform_interface.Client.instance.chatManager
.callNativeMethod(ChatMethodKeys.getUnreadMessageCount);
int ret = 0;
ChatError.hasErrorFromResult(result);
if (result.containsKey(ChatMethodKeys.getUnreadMessageCount)) {
ret = result[ChatMethodKeys.getUnreadMessageCount] as int;
}
return ret;
} catch (e) {
rethrow;
}
}