fetchGroupInfoFromServer method
从服务器获取群组的详细信息。
该方法不获取成员。如需获取成员,使用 fetchMemberListFromServer。
Param groupId
群组 ID。
Return 群组描述。
Throws 如果有异常会在此抛出,包括错误码和错误信息,详见 ChatError。
Implementation
Future<ChatGroup> fetchGroupInfoFromServer(
String groupId, {
bool fetchMembers = false,
}) async {
Map req = {"groupId": groupId, "fetchMembers": fetchMembers};
Map result = await _channel.invokeMethod(
ChatMethodKeys.getGroupSpecificationFromServer, req);
try {
ChatError.hasErrorFromResult(result);
return ChatGroup.fromJson(
result[ChatMethodKeys.getGroupSpecificationFromServer]);
} on ChatError catch (e) {
throw e;
}
}