Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

1371 routine document optimization for agora chat #1411

Merged
merged 29 commits into from
Oct 12, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
b44c8c3
First batch of updates
atovpeko May 12, 2023
4ccc029
Second batch of updates
atovpeko May 15, 2023
b229c1d
Merge branch 'staging' of https://github.com/AgoraIO/Docs-Source into…
atovpeko Jun 23, 2023
137f441
Merge branch 'staging' of https://github.com/AgoraIO/Docs-Source into…
atovpeko Sep 5, 2023
f7135d7
Minor updates + pull from staging
atovpeko Sep 5, 2023
4c6d4f0
PR 3147
atovpeko Sep 5, 2023
4f2795f
PR 3167
atovpeko Sep 5, 2023
7b90a77
Merge branch 'staging' of https://github.com/AgoraIO/Docs-Source into…
atovpeko Sep 5, 2023
fadf81f
PR 3294 through Contacts
atovpeko Sep 5, 2023
44e0928
PR 3294 through Reaction
atovpeko Sep 6, 2023
7dc2a74
PR 3294 complete
atovpeko Sep 8, 2023
083deb1
PR 3311 complete
atovpeko Sep 8, 2023
95dc9ab
PR 3183 complete
atovpeko Sep 11, 2023
126b817
Update Vercel instance
atovpeko Sep 11, 2023
f2e3055
Update Vercel instance
atovpeko Sep 11, 2023
b1f6a4a
Update on review.
billy-the-fish Sep 11, 2023
c1c0b26
Merge branch 'staging' of github.com:AgoraIO/Docs-Source into 1371-ro…
billy-the-fish Sep 11, 2023
b3fa8ff
Update on review.
billy-the-fish Sep 11, 2023
5bfe894
Fixing org_name error
atovpeko Sep 12, 2023
a369720
Fixing error
atovpeko Sep 12, 2023
8f01844
PR 3318
atovpeko Sep 18, 2023
4fe3510
Merge remote-tracking branch 'origin/1371-routine-document-optimizati…
atovpeko Sep 18, 2023
2fe3160
Merge branch 'staging' of https://github.com/AgoraIO/Docs-Source into…
atovpeko Sep 20, 2023
d585680
Latest updates
atovpeko Sep 20, 2023
d71e3cc
September update
atovpeko Sep 26, 2023
9eca399
fix
atovpeko Sep 26, 2023
d5107db
PR 3347
atovpeko Oct 2, 2023
aa0b197
Last update
atovpeko Oct 2, 2023
5c2a371
numbering fix
atovpeko Oct 10, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions agora-chat/develop/ip_allowlist.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
---
title: 'TCP/TLS IP allowlist'
sidebar_position: 7
type: docs
description: >
Describes the TCP/TLS IP allowlist function
---

import IpAllowlist from '@docs/shared/chat-sdk/reference/_ip_allowlist.mdx';

export const toc = [{}];

<IpAllowlist PRODUCT="Chat" COMPANY="Agora" SDK="Chat SDK" CLIENT="app" />
6 changes: 3 additions & 3 deletions agora-chat/develop/ip_whitelist.mdx
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
---
title: 'IP whitelist'
title: 'RESTful API IP whitelist'
sidebar_position: 6
type: docs
description: >
Describes the IP whitelist function
Describes the RESTful API IP whitelist function
---

import IpWhitelist from '@docs/shared/chat-sdk/reference/_ip_whitelist.mdx';

export const toc = [{}];

<IpWhitelist PRODUCT="Chat" COMPANY="Agora" SDK="Chat SDK" CLIENT="app" />
<IpWhitelist PRODUCT="Chat" COMPANY="Agora" SDK="Chat SDK" CLIENT="app" />
13 changes: 13 additions & 0 deletions agora-chat/develop/proxy.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
---
title: 'Cross-border dedicated proxy'
sidebar_position: 7
type: docs
description: >
Describes the cross-border dedicated proxy function
---

import CrossBorderProxy from '@docs/shared/chat-sdk/develop/_cross_border_proxy.mdx';

export const toc = [{}];

<CrossBorderProxy PRODUCT="Chat" COMPANY="Agora" SDK="Chat SDK" CLIENT="app" />
Binary file added assets/images/chat/callback_addr_list.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/images/chat/callback_secret.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
Expand Up @@ -51,27 +51,35 @@ ChatClient.getInstance().groupManager().leaveGroup(groupId);

### Retrieve the member list of a chat group

To retrieve the member list of a chat group, choose the method based on the group size:
- 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.

- If the members of a chat group are greater than or equal to 200, list members of the chat group by page.
- If the members of a chat group are less than 200, call `getGroupFromServer` to retrieve the member list of the chat group.

Refer to the following sample code to retrieve the member list of a chat group:
```java
// If `true` is passed to the second parameter, the SDK returns the group member list that contains up to 200 group members.
// It is a synchronous method and may block the current thread.
Group group = ChatClient.getInstance().groupManager().getGroupFromServer(groupId, true);
List<String> memberList = group.getMembers();// gets regular members.
memberList.addAll(group.getAdminList());// gets group admins.
memberList.add(group.getOwner());// gets the group owner.
```
- When a group has more than 200 members, you can first call the `getGroupFromServer` method to get the group member list that contains the group owner and admins and then call the `fetchGroupMembers` method to obtain the list of regular group members.

```java
// List members of a chat group by page.
List<String> memberList = new ArrayList<>;
// If `true` is passed to the second parameter, the SDK returns the group member list that contains up to 200 group members.
// It is a synchronous method and may block the current thread.
Group group = ChatClient.getInstance().groupManager().getGroupFromServer(groupId, true);

List<String> memberList = new ArrayList<>();
CursorResult<String> result = null;
final int pageSize = 20;
do {
// It is a synchronous method and may block the current thread. The asynchronous method is asyncFetchGroupMembers(String, String, int, ValueCallBack).
result = ChatClient.getInstance().groupManager().fetchGroupMembers(groupId,
result != null? result.getCursor(): "", pageSize);
memberList.addAll(result.getData());
} while (!TextUtils.isnull(result.getCursor()) && result.getData().size() == pageSize);
} while (!TextUtils.isEmpty(result.getCursor()) && result.getData().size() == pageSize);

// Call getGroupFromServer to retrieve the member list of a chat group.
Group group = ChatClient.getInstance().groupManager().getGroupFromServer(groupId, true);
List<String> memberList = group.getMembers();
memberList.addAll(group.getAdminList());// gets group admins.
memberList.add(group.getOwner());// gets the group owner.
```

### Block and unblock a chat group
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,35 +67,39 @@ do {

### Retrieve the member list of a chat group

To retrieve the member list of a chat group, choose the method based on the size of the chat group:
- When a group has less than 200 members, you can call the `getGroupSpecificationFromServerWithId` method to retrieve the group member list that contains the group owner, admins, and regular members.

- If the number of chat group members is greater than or equal to 200, list members of the chat group by page.
- If the number of chat group members is less than 200, call `getGroupSpecificationFromServerWithId` to retrieve the member list of the chat group.
```objc
// If `true` is passed to the second parameter, the SDK returns the group member list that contains up to 200 group members.
// It is a synchronous method. The asynchronous method is [AgoraChatGroupManager getGroupSpecificationFromServerWithId:fetchMembers:completion:].
AgoraChatGroup *group = [[AgoraChatClient sharedClient].groupManager
getGroupSpecificationFromServerWithId:@"groupID"
fetchMembers:YES
error:nil];
NSArray *memberList = group.memberList;
```

Refer to the following sample code to retrieve the member list of a chat group:
- When a group has more than 200 members, you can first call the `getGroupSpecificationFromServerWithId` method to get the group member list that contains the group owner and admins and then call the `getGroupMemberListFromServerWithId` method to obtain the list of regular group members.

```objc
// List members of a chat group by page.
AgoraChatGroup *group = [[AgoraChatClient sharedClient].groupManager
getGroupSpecificationFromServerWithId:@"groupID"
fetchMembers:NO
error:nil];
NSMutableArray *memberList = [[NSMutableArray alloc]init];
NSInteger pageSize = 50;
NSString *cursor = nil;
AgoraChatCursorResult *result = [[AgoraChatCursorResult alloc]init];
do {
result = [[AgoraChatClient sharedClient].groupManager
getGroupMemberListFromServerWithId:@"groupID"
cursor:cursor
pageSize:pageSize
error:nil];
[memberList addObjectsFromArray:result.list];
cursor = result.cursor;
// It is a synchronous method. The asynchronous method is [AgoraChatGroupManager getGroupMemberListFromServerWithId:cursor:pageSize:completion:].
result = [[AgoraChatClient sharedClient].groupManager
getGroupMemberListFromServerWithId:@"groupID"
cursor:cursor
pageSize:pageSize
error:nil];
[memberList addObjectsFromArray:result.list];
cursor = result.cursor;
} while (result && result.list < pageSize);

// Call getGroupSpecificationFromServerWithId to retrieve the member list of a chat group.
AgoraChatGroup *group = [[AgoraChatClient sharedClient].groupManager
getGroupSpecificationFromServerWithId:@"groupID"
fetchMembers:YES
error:nil];
NSArray *memeberList = [group.memberList];
```

### Block and unblock a chat group
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@ Refer to the following sample code to manage the chat group mute list:

```java
// The chat group owner and admins can call muteGroupMember to add the specified member to the chat group mute list. The muted member and all the other chat group admins or owner receive the onMuteListAdded callback.
// If you pass `-1` to `duration`, members are muted permanently.
ChatClient.getInstance().groupManager().muteGroupMembers(groupId, muteMembers, duration);

// The chat group owner and admins can call unmuteGroupMember to remove the specified user from the chat group mute list. The unmuted member and all the other chat group admins or owner receive the onMuteListRemoved callback.
Expand Down
2 changes: 1 addition & 1 deletion shared/chat-sdk/client-api/chat-room/_manage-chatrooms.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import ProjectImplement from '@docs/shared/chat-sdk/client-api/chat-room/manage-

Chat rooms enable real-time messaging among multiple users.

Chat rooms do not have a strict membership, and members do not retain any permanent relationship with each other. Once a chat room member goes offline, this member does not receive any push messages from the chat room and automatically leaves the chat room after 5 minutes. Chat rooms are widely applied in live broadcast use cases such as stream chat in Twitch.
Chat rooms do not have a strict membership, and members do not retain any permanent relationship with each other. Once going offline, chat room members cannot receive any messages from the chat room and automatically leave the chat room after 2 minutes. Chat rooms are widely applied in live broadcast use cases such as stream chat in Twitch.

This page shows how to use the Chat SDK to create and manage a chat room in your app.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,7 @@ Only the chat room owner can disband a chat room. Once a chat room is disbanded,
```objc
// The super admin can call createChatroomWithSubject to create a chat room.
AgoraChatError *error = nil;
AgoraChatroom *retChatroom = [[AgoraChatClient sharedClient].roomManager createChatroomWithSubject:@"aSubject" description:@"aDescription" invitees:@[@"user1",@[user2]]message:@"aMessage" maxMembersCount:aMaxMembersCount error:&error];

AgoraChatroom *retChatroom = [[AgoraChatClient sharedClient].roomManager createChatroomWithSubject:@"aSubject" description:@"aDescription" invitees:@[@"user1",@"user2"]message:@"aMessage" maxMembersCount:aMaxMembersCount error:&error];
// The chat room owner can call destroyChatroom to disband a chat room.
AgoraChatError *error = nil;
[[AgoraChatClient sharedClient].roomManager destroyChatroom:self.chatroom.chatroomId error:&error];
Expand All @@ -30,7 +29,7 @@ AgoraChatError *error = nil;

// All chat room members can call leaveChatroom to leave the specified chat room.
AgoraChatError *error = nil;
[AgoraChatClient sharedClient].roomManager leaveChatroom:@"aChatroomId" error:&error];
[[AgoraChatClient sharedClient].roomManager leaveChatroom:@"aChatroomId" error:&error];
```


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ To monitor the chat room events, you can call `addEventHandler` to listen for th

```javascript
conn.addEventHandler("eventName", {
onGroupEvent: function(msg){
onChatroomEvent: function(msg){
switch(msg.operation){
// Occurs when all the chat room members are unmuted.
case 'unmuteAllMembers':
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,8 @@ You can add a specified user to your block list. Once you do that, you can still

Call `addUserToBlackList` to add the specified user to the block list.

You can add any other users to the block list, regardless of whether they are on the contact list or not. Contacts are still displayed on the contact list even if they are added to the block list. After adding users to the block list, you can still send messages to them, but will not receive messages from them as they cannot send messages or friend requests to you.

```java
// The effect of true and false is the same. I can send messages to users on the blacklist, but I cannot receive them when they send me messages.
ChatClient.getInstance().contactManager().addUserToBlackList(username,true);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -124,9 +124,9 @@ try {

### Add a user to the block list

Call `addUserToBlockList` to add the specified user to the block list. Once you add a user to the block list, you can no longer receive messages from this user.
Call `addUserToBlockList` to add the specified user to the block list.

<div class="note alert">Users can add any other chat user to their block list, regardless of whether this other user is a contact or not. A contact added to the block list remains in the contact list.</div>
You can add any other users to the block list, regardless of whether they are on the contact list or not. Contacts are still displayed on the contact list even if they are added to the block list. After adding users to the block list, you can still send messages to them, but will not receive messages from them as they cannot send messages or friend requests to you.

```dart
// The user ID
Expand Down
32 changes: 13 additions & 19 deletions shared/chat-sdk/client-api/contacts/project-implementation/ios.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -30,32 +30,28 @@ Call `addContact` to add the specified user as a contact:
Use `ContactListener` to add the following callback events. When a user receives a contact invitation, you can accept or decline the invitation.

```objc
/*
* Adds a contact manager delegate
*/
// Adds a contact manager delegate
[[AgoraChatClient sharedClient].contactManager addDelegate:self delegateQueue:nil];
/*
* Removes the contact manager delegate
*/
//Removes the contact manager delegate
[[AgoraChatClient sharedClient].contactManager removeDelegate:self];
```

```objc
/*
* Occurs when a contact invitation is received.
*
* @param aUsername The username that sends the contact invitation.
* @param aMessage The invitation message.
*/
- (void)friendRequestDidReceiveFromUser:(NSString *)aUsername
message:(NSString *)aMessage
{ }

// The peer user accepts the contact invitation.
- (void)friendRequestDidApproveByUser:(NSString *)aUsername
{ }
// The peer user declines the contact invitation.
- (void)friendRequestDidDeclineByUser:(NSString *)aUsername
{ }
// The contact is deleted.
- (void)friendshipDidRemoveByUser:(NSString *)aUsername
{ }
```

#### Accept or decline the contact invitation

After receiving `friendRequestDidReceiveFromUser`, call `approveFriendRequestFromUser` or `declineFriendRequestFromUser` to accept or decline the invitation.
After receiving `friendRequestDidReceiveFromUser`, call `approveFriendRequestFromUser` or `declineFriendRequestFromUser` to accept or decline the invitation. The peer user receives the `friendRequestDidApprove` or `friendRequestDidDecline` callback.

```objc
/*
Expand Down Expand Up @@ -160,9 +156,7 @@ NSArray *userlist = [[AgoraChatClient sharedClient].contactManager getContacts];

### Manage the block list

You can add a specified user to your block list. Once you do that, you can still send chat messages to that user, but you cannot receive messages from them.

<div class="note alert">Users can add any other chat user to their block list, regardless of whether this other user is a contact or not. A contact added to the block list remains in the contact list.</div>
You can add any other users to the block list, regardless of whether they are on the contact list or not. Contacts are still displayed on the contact list even if they are added to the block list. After adding users to the block list, you can still send messages to them, but will not receive messages from them as they cannot send messages or friend requests to you.

#### Add a user to the block list

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -108,9 +108,9 @@ ChatClient.getInstance()

### Add a user to the block list

Call `addUserToBlockList` to add the specified user to the block list. Once you add a user to the block list, you can no longer receive messages from this user.
Call `addUserToBlockList` to add the specified user to the block list.

<div class="note alert">Users can add any other chat user to their block list, regardless of whether this other user is a contact or not. A contact added to the block list remains in the contact list.</div>
You can add any other users to the block list, regardless of whether they are on the contact list or not. Contacts are still displayed on the contact list even if they are added to the block list. After adding users to the block list, you can still send messages to them, but will not receive messages from them as they cannot send messages or friend requests to you.

```typescript
// Specify the user ID to be added to the block list.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -114,9 +114,7 @@ List<string>list = SDKClient.Instance.ContactManager.GetAllContactsFromDB();

### Manage the block list

You can add a specified user to your block list. Once you do that, you can still send chat messages to that user, but you cannot receive messages from them.

<div class="note alert">Users can add any other chat user to their block list, regardless of whether this other user is a contact or not. A contact added to the block list remains in the contact list.</div>
ou can add any other users to the block list, regardless of whether they are on the contact list or not. Contacts are still displayed on the contact list even if they are added to the block list. After adding users to the block list, you can still send messages to them, but will not receive messages from them as they cannot send messages or friend requests to you.

#### Add a user to the block list

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,9 +71,7 @@ WebIM.conn.getContacts().then( (res) => {

### Manage the block list

You can add a specified user to your block list. Once you do that, you can still send chat messages to that user, but you cannot receive messages from them.

<div class="note alert">Users can add any other chat user to their block list, regardless of whether this other user is a contact or not. A contact added to the block list remains in the contact list.</div>
You can add any other users to the block list, regardless of whether they are on the contact list or not. Contacts are still displayed on the contact list even if they are added to the block list. After adding users to the block list, you can still send messages to them, but will not receive messages from them as they cannot send messages or friend requests to you.

#### Add a user to the block list

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -114,9 +114,7 @@ List<string>list = SDKClient.Instance.ContactManager.GetAllContactsFromDB();

### Manage the block list

You can add a specified user to your block list. Once you do that, you can still send chat messages to that user, but you cannot receive messages from them.

<div class="note alert">Users can add any other chat user to their block list, regardless of whether this other user is a contact or not. A contact added to the block list remains in the contact list.</div>
You can add any other users to the block list, regardless of whether they are on the contact list or not. Contacts are still displayed on the contact list even if they are added to the block list. After adding users to the block list, you can still send messages to them, but will not receive messages from them as they cannot send messages or friend requests to you.

#### Add a user to the block list

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ Before proceeding, ensure that your development environment meets the following

- Your project integrates a version of the Chat SDK later than v1.0.3 and has implemented the basic <Link to="/agora-chat/get-started/get-started-sdk">real-time chat functionalities</Link>.
- You understand the API call frequency limit as described in [Limitations](/agora-chat/reference/limitations).
- Because this feature is enabled by the Microsoft Azure Translation API, ensure that you understand the supported target languages as described in [Language support](https://docs.microsoft.com/en-us/azure).
- Because this feature is enabled by the Microsoft Azure Translation API, ensure that you understand the supported target languages as described in [Language support](https://learn.microsoft.com/en-us/azure/ai-services/translator/language-support).
- Translation is not enabled by default. To use this feature, you need to subscribe to the **Pro** or **Enterprise** [pricing plan](/agora-chat/reference/pricing-plan-details) and enable it in [Agora Console](https://console.agora.io/).

<div class="alert note">Add-on fees are incurred if you use this feature. See [Pricing](/agora-chat/reference/pricing#optional-add-on-fee) for details.</div>
Expand Down
Loading
Loading