Use this file to discover all available pages before exploring further.
AI Integration Quick Reference
// Kick a memberCometChat.kickGroupMember(UID: "UID", GUID: "GUID", onSuccess: { response in }, onError: { error in })// Ban a memberCometChat.banGroupMember(UID: "UID", GUID: "GUID", onSuccess: { response in }, onError: { error in })// Unban a memberCometChat.unbanGroupMember(UID: "UID", GUID: "GUID", onSuccess: { response in }, onError: { error in })// Fetch banned memberslet request = BannedGroupMembersRequest.BannedGroupMembersRequestBuilder(guid: "GUID") .set(limit: 30).build()request.fetchNext(onSuccess: { members in }, onError: { error in })
Remove members from a group by kicking or banning them. Kicked users can rejoin; banned users cannot until they’re unbanned. Only admins and moderators can perform these actions.
Admins or Moderators can remove a member using kickGroupMember(). The kicked user can rejoin the group later.
Parameter
Description
UID
The UID of the user to be kicked
GUID
The GUID of the group from which user is to be kicked
Swift
Objective C
let uid = "cometchat-uid-2"let guid = "cometchat-guid-1"CometChat.kickGroupMember(UID: uid, GUID: guid, onSuccess: { (response) in print("\(uid) is kicked from the group \(guid) successfully.")}, onError: { (error) in print("Error: \(error?.errorDescription)")})
NSString *UID = @"cometchat-uid-2";NSString *GUID = @"cometchat-guid-1";[CometChat kickGroupMemberWithUID:UID GUID:GUID onSuccess:^(NSString * response) { NSLog(@"%@ kicked from the group %@ successfully", UID, GUID);} onError:^(CometChatException * error) { NSLog(@"Error: %@", [error errorDescription]);}];
The kicked user will be no longer part of the group and can not perform any actions in the group, but the kicked user can rejoin the group.
Admins or Moderators can ban a member using banGroupMember(). Unlike kicked users, banned users cannot rejoin until unbanned.
Parameter
Description
UID
The UID of the user to be banned
GUID
The GUID of the group from which user is to be banned
Swift
Objective C
let uid = "cometchat-uid-2"let guid = "cometchat-guid-1"CometChat.banGroupMember(UID: uid, GUID: guid, onSuccess: { (response) in print("\(uid) is banned from the group \(guid) successfully.")}, onError: { (error) in print("Error: \(error?.errorDescription)")})
NSString *UID = @"cometchat-uid-2";NSString *GUID = @"cometchat-guid-1";[CometChat banGroupMemberWithUID:UID GUID:GUID onSuccess:^(NSString * response) { NSLog(@"%@ banned from the group %@ successfully", UID, GUID);} onError:^(CometChatException * error) { NSLog(@"Error: %@", [error errorDescription]);}];
The banned user will be no longer part of the group and can not perform any actions in the group. A banned user cannot rejoin the same group without being unbanned.
Admins or Moderators can unban a previously banned member using unbanGroupMember().
Parameter
Description
UID
The UID of the user to be unbanned
GUID
The GUID of the group from which user is to be unbanned
Swift
Objective C
let uid = "cometchat-uid-2"let guid = "cometchat-guid-1"CometChat.unbanGroupMember(UID: uid, GUID: guid, onSuccess: { (response) in print("\(uid) is unbanned from the group \(guid) successfully.")}, onError: { (error) in print("Error: \(error?.errorDescription)")})
NSString *UID = @"cometchat-uid-2";NSString *GUID = @"cometchat-guid-1";[CometChat unbanGroupMemberWithUID:UID GUID:GUID onSuccess:^(NSString * response) { NSLog(@"%@ unbanned from the group %@ successfully", UID, GUID);} onError:^(CometChatException * error) { NSLog(@"Error: %@", [error errorDescription]);}];