fetchJoinedGroupCount method

Future<int> fetchJoinedGroupCount()

~english Gets the number of groups joined by the current user from the server.

Returns The count of joined groups.

Throws Exception description, see EMError. ~end

~chinese 从服务器获取当前用户已加入的群组数量。

Return 已加入的群组数量。

Throws 如果有异常会在这里抛出,包含错误码和错误描述,详见 EMError。 ~end

Implementation

Future<int> fetchJoinedGroupCount() async {
  try {
    Map result = await Client.instance.groupManager
        .callNativeMethod(ChatMethodKeys.fetchJoinedGroupCount);
    EMError.hasErrorFromResult(result);
    int count = result[ChatMethodKeys.fetchJoinedGroupCount];
    return count;
  } catch (e) {
    rethrow;
  }
}