blockGroup method
- String groupId
~english Blocks group messages. The server will no longer send messages from this group to the user. The group owner cannot block group messages.
Param groupId The ID of the group to block.
Returns None.
Throws Exception description, see EMError. ~end
~chinese 屏蔽群消息,服务器不再发送此群的消息给用户,群主不能屏蔽群消息。
Param groupId 要屏蔽的群组 ID。
Return 无。
Throws 如果有异常会在这里抛出,包含错误码和错误描述,详见 EMError. ~end
Implementation
Future<void> blockGroup(String groupId) async {
try {
Map req = {'groupId': groupId};
Map result = await Client.instance.groupManager
.callNativeMethod(ChatMethodKeys.blockGroup, req);
EMError.hasErrorFromResult(result);
} catch (e) {
rethrow;
}
}