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

Modify Agora Chat EN Doc #3787

Merged
merged 8 commits into from
Oct 25, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
Original file line number Diff line number Diff line change
Expand Up @@ -42,14 +42,14 @@ Set `ChatGroupStyle` and `inviteNeedConfirm` before creating a chat group.
2. Does a group invitation require consent from an invitee to add them to the group (`inviteNeedConfirm`):

- Yes (`ChatGroupOptions#inviteNeedConfirm` is set to `true`). After creating a group and sending group invitations, the subsequent logic varies based on whether an invitee automatically consents to the group invitation (`autoAcceptGroupInvitation`):
- Yes (`autoAcceptGroupInvitation` is set to `true`). The invitee automatically joins the chat group and receives the `ChatGroupEventHandler#onAutoAcceptInvitationFromGroup` callback, the chat group owner receives the `ChatGroupEventHandler#onInvitationAcceptedFromGroup` and `ChatGroupEventHandler#onMemberJoinedFromGroup` callbacks, and the other chat group members receives the `ChatGroupEventHandler#onMemberJoinedFromGroup` callback.
- Yes (`autoAcceptGroupInvitation` is set to `true`). The invitee automatically joins the chat group and receives the `ChatGroupEventHandler#onAutoAcceptInvitationFromGroup` callback, the inviter receives the `ChatGroupEventHandler#onInvitationAcceptedFromGroup` and `ChatGroupEventHandler#onMemberJoinedFromGroup` callbacks, and the other chat group members receives the `ChatGroupEventHandler#onMemberJoinedFromGroup` callback.
- No (`autoAcceptGroupInvitation` is set to `false`). The invitee receives the `ChatGroupEventHandler#onInvitationReceivedFromGroup` callback and chooses whether to join the chat group:
- If the invitee accepts the group invitation, the chat group owner receives the `ChatGroupEventHandler#onInvitationAcceptedFromGroup` and `ChatGroupEventHandler#onMemberJoinedFromGroup` callbacks, and the other chat group members receive the `ChatGroupEventHandler#onMemberJoinedFromGroup` callback;
- If the invitee accepts the group invitation, the inviter receives the `ChatGroupEventHandler#onInvitationAcceptedFromGroup` and `ChatGroupEventHandler#onMemberJoinedFromGroup` callbacks, and the other chat group members receive the `ChatGroupEventHandler#onMemberJoinedFromGroup` callback;
- If the invitee declines the group invitation, the chat group owner receives the `ChatGroupEventHandler#onInvitationDeclinedFromGroup` callback.

![](https://web-cdn.agora.io/docs-files/1653385689954)

- No (`ChatGroupOptions#inviteNeedConfirm` is set to `false`). After creating a chat group and sending group invitations, an invitee is added to the chat group regardless of their `autoAcceptGroupInvitation` setting. The invitee receives the `ChatGroupEventHandler#onAutoAcceptInvitationFromGroup` callback, the chat group owner receives the `ChatGroupEventHandler#onInvitationAcceptedFromGroup` and `ChatGroupEventHandler#onMemberJoinedFromGroup` callbacks, and the other chat group members receive the `ChatGroupEventHandler#onMemberJoinedFromGroup` callback.
- No (`ChatGroupOptions#inviteNeedConfirm` is set to `false`). After creating a chat group and sending group invitations, an invitee is added to the chat group regardless of their `autoAcceptGroupInvitation` setting. The invitee receives the `ChatGroupEventHandler#onAutoAcceptInvitationFromGroup` callback, the inviter receives the `ChatGroupEventHandler#onInvitationAcceptedFromGroup` and `ChatGroupEventHandler#onMemberJoinedFromGroup` callbacks, and the other chat group members receive the `ChatGroupEventHandler#onMemberJoinedFromGroup` callback.

Users can call `createGroup` to create a chat group and set the chat group attributes such as the chat group name, description, maximum number of members, and reason for creating the group, by specifying `ChatGroupOptions`.

Expand Down Expand Up @@ -125,7 +125,7 @@ try {

### Leave a chat group

Chat group members can call `leave` to leave the specified chat group, whereas the chat group owner cannot perform this operation. Once a member leaves a chat group, all the other chat group members receive the `ChatGroupEventHandler#onMemberExitedFromGroup` callback.
Chat group members can call `leaveGroup` to leave the specified chat group, whereas the chat group owner cannot perform this operation. Once a member leaves a chat group, all the other chat group members receive the `ChatGroupEventHandler#onMemberExitedFromGroup` callback.

The following code sample shows how to leave a chat group:

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ do {

### Block and unblock a chat group

All chat group members can block and unblock a chat group. Once a member block a chat group, they no longer receive messages from this 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.

Refer to the following sample code to block and unblock a chat group:

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Chat groups are features that enable instant messaging among multiple chat users. The relationship between chat group members is persistent: chat group members can send and receive messages in the group and also receive push messages when they are offline.
Chat groups are features that enable instant messaging among multiple chat users. The relationship between chat group members is persistent: chat group members can send and receive messages in the group and also receive push notifications when they are offline.

## Chat group types

Expand Down Expand Up @@ -29,8 +29,8 @@ The specific feature differences are listed in the following table:
| --- | --- | --- |
| Use cases | Group chat scenarios in Signal and Skype, where members have a preexisting relationship with each other. | Stream chat scenarios in Twitch, where viewers have no relationship with each other. Once a member quits the stream channel, they leave the chat room. |
| Maximum number of members | 5,000 | 20,000+ |
| Message push support | Members receive push messages when they go offline. | Members do not receive push messages when they go offline. |
| Offline message storage | This feature is supported. Agora Chat servers store messages sent to offline group members and sends to them once they go back online. A maximum number of 200 messages across chat groups can be stored per end user. | Chat room does not store messages sent to offline chat room members and this feature is not supported in chat rooms. |
| Message push support | If the offline push function is integrated, members receive push notifications when they go offline. | Members do not receive push notifications when they go offline, as the offline push function is supported in chat rooms. |
| Offline message storage | This feature is supported. Agora Chat servers store messages sent to offline group members and send to them once they go back online. A maximum number of 200 messages across chat groups can be stored per end user. | Chat room does not store messages sent to offline chat room members and this feature is not supported in chat rooms. |
| Message history | Agora Chat servers store message history, subject to the [data retention period of your package selection](https://docs.agora.io/en/agora-chat/reference/pricing-plan-details?platform=android#message). The history can be retrieved by your app server via [this RESTful API](https://docs.agora.io/en/agora-chat/restful-api/message-management?platform=android#retrieve-historical-messages), in the format of JSON files. You can call [this Client API](https://docs.agora.io/en/agora-chat/client-api/messages/retrieve-messages?platform=android#retrieve-historical-messages-of-the-specified-conversation) to allow the SDK to retrieve message history of a chat group. This allows end users to synchronize messages history across multiple end devices. | Agora Chat servers store message history, subject to the [data retention period of your package selection](https://docs.agora.io/en/agora-chat/reference/pricing-plan-details?platform=android#message). The history can be retrieved by your app server via [this RESTful API](https://docs.agora.io/en/agora-chat/restful-api/message-management?platform=android#retrieve-historical-messages), in the format of JSON files. Agora Chat currently does not support SDK retrieving message history of a chat room via client APIs. However, when a user joins a chat room, Agora Chat servers can send 10 most recent messages to the client side via the message receiving callback. To enable this function, you need to contact [[email protected]](mailto:[email protected]). The number of historical messages sent to the new chat room member can be increased up to 200, without additional charges.|
| Message reliability | Each member receives all the messages in the chat group. | Members might not see all messages. The SDK discards messages if the chat room message threshold is exceeded. The default threshold is 100 messages per second. You can adjust this threshold according to your needs. |

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,10 +42,10 @@ Set `GroupStyle` and `inviteNeedConfirm` before creating a chat group.
2. Does a group invitation require consent from an invitee to add them to the group (`inviteNeedConfirm`):

- Yes (`option.InviteNeedConfirm` is set to `true`). After creating a group and sending group invitations, the subsequent logic varies based on whether an invitee automatically consents to the group invitation (`AutoAcceptGroupInvitation`):
- Yes (`AutoAcceptGroupInvitation` is set to `true`). The invitee automatically joins the chat group and receives the `IGroupManagerDelegate#OnAutoAcceptInvitationFromGroup` callback, the chat group owner receives the `IGroupManagerDelegate#OnInvitationAcceptedFromGroup` and `IGroupManagerDelegate#OnMemberJoinedFromGroup` callbacks, and the other chat group members receives the `IGroupManagerDelegate#OnMemberJoinedFromGroup` callback.
- Yes (`AutoAcceptGroupInvitation` is set to `true`). The invitee automatically joins the chat group and receives the `IGroupManagerDelegate#OnAutoAcceptInvitationFromGroup` callback, the inviter receives the `IGroupManagerDelegate#OnInvitationAcceptedFromGroup` and `IGroupManagerDelegate#OnMemberJoinedFromGroup` callbacks, and the other chat group members receives the `IGroupManagerDelegate#OnMemberJoinedFromGroup` callback.
- No (`AutoAcceptGroupInvitation` is set to `false`). The invitee receives the `IGroupManagerDelegate#OnInvitationReceivedFromGroup` callback and chooses whether to join the chat group:
- If the invitee accepts the group invitation, the chat group owner receives the `IGroupManagerDelegate#OnInvitationAcceptedFromGroup` and `IGroupManagerDelegate#OnMemberJoinedFromGroup` callbacks and the other chat group members receive the `IGroupManagerDelegate#OnMemberJoinedFromGroup` callback;
- If the invitee declines the group invitation, the chat group owner receives the`IGroupManagerDelegate#OnInvitationDeclinedFromGroup` callback.
- If the invitee accepts the group invitation, the inviter receives the `IGroupManagerDelegate#OnInvitationAcceptedFromGroup` and `IGroupManagerDelegate#OnMemberJoinedFromGroup` callbacks and the other chat group members receive the `IGroupManagerDelegate#OnMemberJoinedFromGroup` callback;
- If the invitee declines the group invitation, the inviter receives the`IGroupManagerDelegate#OnInvitationDeclinedFromGroup` callback.

![](https://web-cdn.agora.io/docs-files/1652923565779)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ This page shows how to use the Agora Chat SDK to create and manage a chat group

## Understand the tech

The Agora Chat SDK provides the `GroupManager` and `Group` classes for chat group management, which allows you to implement the following features:
The Agora Chat SDK allows you to implement the following group management features:

- Create and destroy a chat group
- Join and leave a chat group
Expand Down Expand Up @@ -76,7 +76,7 @@ Users can request to join a public chat group as follows:
- If the `approval` parameter of the group type is set to `false`, the request from the user is accepted automatically and the chat group members receive the `memberPresence` callback.
- If the `approval` parameter is set to `true`, the chat group owner and chat group admins receive the `requestToJoin` callback and determine whether to accept the request from the user.

Users can call `memberAbsence` to leave a chat group. Once a user leaves the group, all the other group members receive the `memberAbsence` callback.
Users can call `joinGroup` to leave a chat group. Once a user leaves the group, all the other group members receive the `memberAbsence` callback.

Refer to the following sample code to join and leave a chat group:

Expand Down Expand Up @@ -105,7 +105,7 @@ let options = {
};
conn.joinGroup(options).then(res => console.log(res))

// Call memberAbsence to leave a chat group.
// Call leaveGroup to leave a chat group.
let option = {
groupId: "groupId"
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ List<ChatMessage> messages = conversation.searchMsgFromDB(keywords, timeStamp, m

### Import messages

Call `importMessages` to import multiple messages to the specified conversation. This applies to scenarios where chat users want to formard messages from another conversation.
Call `importMessages` to import multiple messages to the specified conversation.

```java
ChatClient.getInstance().chatManager().importMessages(msgs);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -89,12 +89,12 @@ AgoraChatConversation *conversation = [[AgoraChatClient sharedClient].chatManage

You can delete conversations on both the local device and the server.

To delete them on the local device, call `deleteConversation` and `removeMessage`:
To delete them on the local device, call `deleteConversation` and `deleteMessageWithId`:

```objective-c
// Deletes the specified conversation. To keep the historical messages, set isDeleteMessages as NO.
[[AgoraChatClient sharedClient].chatManager deleteConversation:conversationId isDeleteMessages:YES completion:nil];
// Deletes the specified conversation.
// Deletes the specified conversations.
NSArray *conversations = @{@"conversationID1",@"conversationID2"};
[[AgoraChatClient sharedClient].chatManager deleteConversations:conversations isDeleteMessages:YES completion:nil];
// Deletes the specified message of the current conversation.
Expand Down Expand Up @@ -142,7 +142,7 @@ NSArray<AgoraChatMessage *> *messages = [conversation loadMessagesWithKeyword:ke

### Import messages

Call `importMessages` to import multiple messages to the specified conversation. This applies to scenarios where chat users want to formard messages from another conversation.
Call `importMessages` to import multiple messages to the specified conversation.

```objective-c
[[AgoraChatClient sharedClient].chatManager importMessages:messages completion:nil];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ ChatClient.getInstance()

### Delete conversations and historical messages

The SDK provides two methods, which enables you to delete the conversations and historical messages on the local device and on the server respectively.
The SDK provides two methods, which enable you to delete the conversations and historical messages on the local device and on the server respectively.

To delete them on the local device, call `deleteConversation`:

Expand Down Expand Up @@ -244,7 +244,7 @@ ChatClient.getInstance().chatManager.searchMsgFromDB(

### Import messages

Call `importMessages` to import multiple messages to the specified conversation. This applies to scenarios where chat users want to formard messages from another conversation.
Call `importMessages` to import multiple messages to the specified conversation.

```typescript
// Construct the messages.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ List<Message> list = SDKClient.Instance.ChatManager.SearchMsgFromDB(keywords, ti

### Import messages

Call `ImportMessages` to import multiple messages to the specified conversation. This applies to scenarios where chat users want to formard messages from another conversation.
Call `ImportMessages` to import multiple messages to the specified conversation.

```C#
SDKClient.Instance.ChatManager.ImportMessages(messages, new CallBack(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -286,11 +286,11 @@ Follow the steps to implement read receipts for a chat group message:
ChatClient.getInstance()
.chatManager.sendGroupMessageReadAck(msgId, groupId)
.then(() => {
// Print a log here is the message sending succeeds.
// Print a log here if the message sending succeeds.
console.log("send message read success.");
})
.catch((reason) => {
// Print a log here is the message sending fails.
// Print a log here if the message sending fails.
console.log("send message read fail.", reason);
});
```
Loading
Loading