Use this file to discover all available pages before exploring further.
AI Integration Quick Reference
// Fetch groups listlet request = GroupsRequest.GroupsRequestBuilder() .set(limit: 30).build()request.fetchNext(onSuccess: { groups in }, onError: { error in })// Get specific group detailsCometChat.getGroup(GUID: "GUID", onSuccess: { group in }, onError: { error in })// Fetch only joined groupslet joinedRequest = GroupsRequest.GroupsRequestBuilder() .set(limit: 30).set(joinedOnly: true).build()// Get online member countCometChat.getOnlineGroupMemberCount(["GUID"], onSuccess: { countData in }, onError: { error in })
Fetch the list of Group objects the logged-in user can see, get details for a specific group, or check online member counts.
When true, includes tag data in the returned group objects.
Swift
let groupsRequest = GroupsRequest.GroupsRequestBuilder() .set(limit: 30) .withTags(true) .build()
After configuring the builder, call build() to get the GroupsRequest object, then call fetchNext() to retrieve groups.
The list only includes public and password-protected groups. Private groups appear only if the user is a member.
Swift
Objective C
let limit = 30let groupsRequest = GroupsRequest.GroupsRequestBuilder(limit: limit).build()groupsRequest.fetchNext(onSuccess: { (groups) in for group in groups { print("Group: \(group.stringValue())") }}, onError: { (error) in print("Error: \(error?.errorDescription)")})
Use getOnlineGroupMemberCount() to get the number of online members in specified groups.
Swift
let guids = ["cometchat-guid-1", "cometchat-guid-2"]CometChat.getOnlineGroupMemberCount(guids, onSuccess: { countData in // countData: [String: Int] - GUID as key, count as value for (guid, count) in countData { print("Group \(guid): \(count) online members") }}, onError: { error in print("Error: \(error?.errorDescription)")})
Returns a [String: Int] dictionary with GUIDs as keys and online member counts as values.