declineJoinApplication method
拒绝入群申请。 仅群主有权限调用。
Param groupId 被拒绝的群组 ID。
Param username 申请人用户名。
Param reason 拒绝理由。
Return 无。
Throws 如果有异常会在这里抛出,包含错误码和错误描述,详见 ChatError.
Implementation
Future<void> declineJoinApplication(
String groupId,
String username, {
String? reason,
}) async {
try {
Map req = {'groupId': groupId, 'userId': username};
req.putIfNotNull('reason', reason);
Map result = await platform_interface.Client.instance.groupManager
.callNativeMethod(ChatMethodKeys.declineJoinApplication, req);
ChatError.hasErrorFromResult(result);
} catch (e) {
rethrow;
}
}