Skip to content

Commit

Permalink
modify
Browse files Browse the repository at this point in the history
  • Loading branch information
haoxiuwen committed Dec 5, 2024
1 parent 05ca88b commit dac1b0e
Show file tree
Hide file tree
Showing 7 changed files with 96 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,42 @@ ChatClient.getInstance().groupManager().joinGroup(groupId);
ChatClient.getInstance().groupManager().leaveGroup(groupId);
```

### Retrieve the chat group list

Users can call `getJoinedGroupsFromServer` to retrieve from the server the list of chat groups that they created and joined.

```java
// It is an asynchronous method. The synchronous method is getJoinedGroupsFromServer(int, int, boolean, boolean).
// pageIndex: The current page number, starting from 0.
// pageSize: The number of groups to retrieve per page. The value range is [1,20].
List<Group> grouplist = ChatClient.getInstance().groupManager().asyncGetJoinedGroupsFromServer(pageIndex, pageSize, needMemberCount, needRole, new ValueCallBack<List<Group>>() {
@Override
public void onSuccess(List<Group> value) {

}

@Override
public void onError(int error, String errorMsg) {

}
});
```

- Users can call `getAllGroups` to load the list of created and joined chat groups from the local database. To ensure data accuracy, users need to first obtain from the server the list of chat groups that they created and joined.

```java
List<Group> grouplist = ChatClient.getInstance().groupManager().getAllGroups();
```

- Users can call `getPublicGroupsFromServer` to retrieve the list of public groups:

```java
// It is a synchronous method and may block the current thread. The asynchronous method is asyncGetPublicGroupsFromServer(int, String, ValueCallBack).
CursorResult<GroupInfo> result = ChatClient.getInstance().groupManager().getPublicGroupsFromServer(pageSize, cursor);
List<GroupInfo> groupsList = result.getData();
String cursor = result.getCursor();
```

### Retrieve the member list of a chat group

- When a group has less than 200 members, you can call the `getGroupFromServer` method to retrieve the group member list that contains the group owner, admins, and regular members.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@ try {

### Retrieve the chat group list

Users can call `fetchJoinedGroupsFromServer` to retrieve the joined chat group list from the server with pagination, as shown in the following code sample:
Users can call `fetchJoinedGroupsFromServer` to retrieve from the server the list of chat groups that they created and joined:

```dart
try {
Expand All @@ -186,7 +186,7 @@ try {
}
```

Users can call `getJoinedGroups` to retrieve the joined chat group list from the local database. To ensure the accuracy of results, retrieve the joined chat group list from the server first. The code sample is as follows:
Users can call `getJoinedGroups` to load the list of created and joined chat groups from the local database. To ensure data accuracy, users need to first obtain from the server the list of chat groups that they created and joined.

```dart
try {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,34 @@ do {
} while (result && result.list < pageSize);
```

### Retrieve the chat group list

Users can call `getJoinedGroupsFromServer` to retrieve from the server the list of chat groups that they created and joined.

```swift
// It is an asynchronous method.
AgoraChatClient.shared().groupManager?.getJoinedGroupsFromServer(withPage: 0, pageSize: 20, needMemberCount: true, needRole: true, completion: { groups, err in
// group list
})
```

- Users can call `getJoinedGroups` to load the list of created and joined chat groups from the local database. To ensure data accuracy, users need to first obtain from the server the list of chat groups that they created and joined.

```swift
// It is a synchronous method.
let groups = AgoraChatClient.shared().groupManager?.getJoinedGroups()
```

- Users can call `getPublicGroupsFromServerWithCursor` to retrieve the list of public groups:

```swift
AgoraChatClient.shared().groupManager?.getPublicGroupsFromServer(withCursor: "", pageSize: 20, completion: { result, err in
if let groups = result?.list {
// got groups
}
})
```

### Block and unblock a chat group

All chat group members can block and unblock a chat group. Once members block a chat group, they no longer receive messages from this chat group.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -209,12 +209,12 @@ ChatClient.getInstance()

### Retrieve the chat group list

Users can call `fetchJoinedGroupsFromServer` to retrieve the joined chat group list from the server with pagination, as shown in the following code sample:
Users can call `fetchJoinedGroupsFromServer` to retrieve from the server the list of chat groups that they created and joined:

```typescript
// The maximum number of chat groups to retrieve with pagination.
// The number of groups to retrieve per page. The value range is [1,20].
const pageSize = 10;
// The page number from which to start getting data.
// The current page number, starting from 0.
const pageNum = 1;
ChatClient.getInstance()
.groupManager.fetchJoinedGroupsFromServer(pageSize, pageNum)
Expand All @@ -226,7 +226,7 @@ ChatClient.getInstance()
});
```

Users can call `getJoinedGroups` to retrieve the joined chat group list from the local database. To ensure the accuracy of results, retrieve the joined chat group list from the server first. The code sample is as follows:
Users can call `getJoinedGroups` to load the list of created and joined chat groups from the local database. To ensure data accuracy, users need to first obtain from the server the list of chat groups that they created and joined.

```typescript
ChatClient.getInstance()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ SDKClient.Instance.GroupManager.GetGroupMemberListFromServer(groupId, pageSize,

### Retrieve the chat group list

Users can call `FetchJoinedGroupsFromServer` to retrieve the joined chat group list from the server, as shown in the following code sample:
Users can call `FetchJoinedGroupsFromServer` to retrieve from the server the list of chat groups that they created and joined:

```c#
SDKClient.Instance.GroupManager.FetchJoinedGroupsFromServer(callback: new ValueCallBack<List<Group>>(
Expand All @@ -196,7 +196,7 @@ SDKClient.Instance.GroupManager.FetchJoinedGroupsFromServer(callback: new ValueC
));
```

Users can call `GetJoinedGroups` to retrieve the joined chat group list from the local database. To ensure the accuracy of results, retrieve the joined chat group list from the server first. The code sample is as follows:
Users can call `GetJoinedGroups` to load the list of created and joined chat groups from the local database. To ensure data accuracy, users need to first obtain from the server the list of chat groups that they created and joined.

```c#
List<Group> groupList = SDKClient.Instance.GroupManager.GetJoinedGroups();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,28 @@ let option = {
conn.leaveGroup(option).then(res => console.log(res))
```

### Retrieve the chat group list

Users can call `getJoinedGroups` to retrieve from the server the list of chat groups that they created and joined:

```javascript
conn.getJoinedGroups({
pageNum: 0,
pageSize: 20,
needAffiliations: true,
needRole: true,
});
```

- Users can also call `getPublicGroups` to retrieve list of public chat groups from the server with pagination:

```javascript
let option = {
limit: 20,
cursor: cursor,
};
conn.getPublicGroups(option).then((res) => console.log(res));
```

### Retrieve the member list of a chat group

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ SDKClient.Instance.GroupManager.GetGroupMemberListFromServer(groupId, pageSize,

### Retrieve the chat group list

Users can call `FetchJoinedGroupsFromServer` to retrieve the joined chat group list from the server, as shown in the following code sample:
Users can call `FetchJoinedGroupsFromServer` to retrieve from the server the list of chat groups that they created and joined:

```c#
SDKClient.Instance.GroupManager.FetchJoinedGroupsFromServer(callback: new ValueCallBack<List<Group>>(
Expand All @@ -196,7 +196,7 @@ SDKClient.Instance.GroupManager.FetchJoinedGroupsFromServer(callback: new ValueC
));
```

Users can call `GetJoinedGroups` to retrieve the joined chat group list from the local database. To ensure the accuracy of results, retrieve the joined chat group list from the server first. The code sample is as follows:
Users can call `GetJoinedGroups` to load the list of created and joined chat groups from the local database. To ensure data accuracy, users need to first obtain from the server the list of chat groups that they created and joined.

```c#
List<Group> groupList = SDKClient.Instance.GroupManager.GetJoinedGroups();
Expand Down

0 comments on commit dac1b0e

Please sign in to comment.