diff --git a/en-US/markdown/agora-chat/Develop/Messages/Send and Receive Messages/agora_chat_send_receive_message_android.md b/en-US/markdown/agora-chat/Develop/Messages/Send and Receive Messages/agora_chat_send_receive_message_android.md index bfc8dbed63a..eabec0f712b 100644 --- a/en-US/markdown/agora-chat/Develop/Messages/Send and Receive Messages/agora_chat_send_receive_message_android.md +++ b/en-US/markdown/agora-chat/Develop/Messages/Send and Receive Messages/agora_chat_send_receive_message_android.md @@ -344,8 +344,6 @@ MessageListener msgListener = new MessageListener() ### Send a customized message -Custom messages are self-defined key-value pairs that include the message type and the message content. - The following code example shows how to create and send a customized message: ```java diff --git a/en-US/markdown/agora-chat/Develop/Messages/Send and Receive Messages/agora_chat_send_receive_message_flutter.md b/en-US/markdown/agora-chat/Develop/Messages/Send and Receive Messages/agora_chat_send_receive_message_flutter.md index bba9eebc1a8..7e283ece55d 100644 --- a/en-US/markdown/agora-chat/Develop/Messages/Send and Receive Messages/agora_chat_send_receive_message_flutter.md +++ b/en-US/markdown/agora-chat/Develop/Messages/Send and Receive Messages/agora_chat_send_receive_message_flutter.md @@ -3,7 +3,6 @@ After logging in to Agora Chat, users can send the following types of messages t - Attachment messages, including image, voice, video, and file messages. - Location messages. - CMD messages. -- Extended messages. - Custom messages. In high-concurrency scenarios, you can set a certain message type or messages from a chat room member as high, normal, or low. In this case, low-priority messages are dropped first to reserve resources for the high-priority ones (e.g. gifts and announcements) when the server is overloaded. This ensures that the high-priority messages can be dealt with first when loads of messages are being sent in high concurrency or high frequency. Note that this feature can increase the delivery reliability of high-priority messages, but cannot guarantee the deliveries. Even high-priorities messages can be dropped when the server load goes too high. @@ -89,7 +88,7 @@ ChatMessage fileMsg = ChatMessage.createFileSendMessage( fileSize: fileSize, ); // Creates a location message. You need to set the longitude and latitude information of the location, as well as the name of the location. -// To send a location message, you need to integrate a third-party map service provider to get the longitude and latitude information of the location. When the recipient receives the location information, the service provider renders the location on the map according to the longitude and latitude information. +// To send a location message, you need to integrate a third-party map service to get the longitude and latitude information of the location. When the recipient receives the location information, the service renders the location on the map according to the longitude and latitude information. double latitude = 114.78; double longitude = 39.89; String address = "darwin"; @@ -201,7 +200,7 @@ When a voice message is received, the SDK automatically downloads the audio file For image and video messages, the SDK automatically generates a thumbnail when you create the message. When an image or video message is received, the SDK automatically downloads the thumbnail. To manually download the attachment files, follow the steps: -1. Set `isAutoDownloadThumbnail` as true when initializing the SDK. +1. Set `isAutoDownloadThumbnail` as `false` when initializing the SDK. ```dart ChatOptions options = ChatOptions( diff --git a/en-US/markdown/agora-chat/Develop/Messages/Send and Receive Messages/agora_chat_send_receive_message_ios.md b/en-US/markdown/agora-chat/Develop/Messages/Send and Receive Messages/agora_chat_send_receive_message_ios.md index 4f3bbfa85b1..80b603bec94 100644 --- a/en-US/markdown/agora-chat/Develop/Messages/Send and Receive Messages/agora_chat_send_receive_message_ios.md +++ b/en-US/markdown/agora-chat/Develop/Messages/Send and Receive Messages/agora_chat_send_receive_message_ios.md @@ -170,7 +170,7 @@ AgoraChatMessage *message = [[AgoraChatMessage alloc] initWithConversationID:toC body:body ext:messageExt]; message.chatType = AgoraChatTypeChat; -// Set the chat type as Group chat. You can also set is as chat (one-to-one chat) or chat room. +// Set the chat type as Group chat. You can also set it as chat (one-to-one chat) or chat room. // message.chatType = AgoraChatTypeGroupChat; // Sends the message [[AgoraChatClient sharedClient].chatManager sendMessage:message @@ -212,7 +212,7 @@ AgoraChatMessage *message = [[AgoraChatMessage alloc] initWithConversationID:toC body:body ext:messageExt]; message.chatType = AgoraChatTypeChat; -// Set the chat type as Group chat. You can also set is as chat (one-to-one chat) or chat room. +// Set the chat type as Group chat. You can also set it as chat (one-to-one chat) or chat room. // message.chatType = AgoraChatTypeGroupChat; // Sends the message [[AgoraChatClient sharedClient].chatManager sendMessage:message @@ -235,7 +235,7 @@ NSString *remotePath = body.remotePath; NSString *thumbnailPath = body.thumbnailRemotePath; // Retrieves the path of the video file on the local device. NSString *localPath = body.localPath; -// Retrieves the thumbnail of the video file on the local deivce. +// Retrieves the thumbnail of the video file on the local device. NSString *thumbnailLocalPath = body.thumbnailLocalPath; ``` @@ -245,7 +245,7 @@ Refer to the following code example to create, send, and receive a file message: ```objective-c // Set fileData as the path of the file on the local device, and fileName the display name of the attachment file. -AgoraChatFileMessageBody *body = [[AgoraChatFileMessageBody initWithData:fileData +AgoraChatFileMessageBody *body = [AgoraChatFileMessageBody initWithData:fileData displayName:fileName]; AgoraChatMessage *message = [[AgoraChatMessage alloc] initWithConversationID:toChatUsername from:fromChatUsername @@ -253,7 +253,7 @@ AgoraChatMessage *message = [[AgoraChatMessage alloc] initWithConversationID:toC body:body ext:messageExt]; message.chatType = AgoraChatTypeChat; -// Set the chat type as Group chat. You can also set is as chat (one-to-one chat) or chat room. +// Set the chat type as Group chat. You can also set it as chat (one-to-one chat) or chat room. // message.chatType = AgoraChatTypeGroupChat; // Sends the message [[AgoraChatClient sharedClient].chatManager sendMessage:message @@ -294,7 +294,7 @@ AgoraChatMessage *message = [[AgoraChatMessage alloc] initWithConversationID:toC body:body ext:messageExt]; message.chatType = AgoraChatTypeChat; -// Set the chat type as Group chat. You can also set is as chat (one-to-one chat) or chat room. +// Set the chat type as Group chat. You can also set it as chat (one-to-one chat) or chat room. // message.chatType = AgoraChatTypeGroupChat; // Sends the message [[AgoraChatClient sharedClient].chatManager sendMessage:message @@ -317,7 +317,7 @@ AgoraChatMessage *message = [[AgoraChatMessage alloc] initWithConversationID:toC body:body ext:messageExt]; message.chatType = AgoraChatTypeChat; -// Set the chat type as Group chat. You can also set is as chat (one-to-one chat) or chat room. +// Set the chat type as Group chat. You can also set it as chat (one-to-one chat) or chat room. // message.chatType = AgoraChatTypeGroupChat; // Sends the message [[AgoraChatClient sharedClient].chatManager sendMessage:message @@ -325,7 +325,7 @@ message.chatType = AgoraChatTypeChat; completion:nil]; ``` -To notify the recipient that a CMD message is received, use a seperate delegate so that users can deal with the message differently. +To notify the recipient that a CMD message is received, use a separate delegate so that users can deal with the message differently. ```objective-c // Occurs when the CMD message is received. @@ -339,8 +339,6 @@ To notify the recipient that a CMD message is received, use a seperate delegate ### Send a customized message -Custom messages are self-defined key-value pairs that include the message type and the message content. - The following code example shows how to create and send a customized message: ```objective-c diff --git a/en-US/markdown/agora-chat/Develop/Messages/Send and Receive Messages/agora_chat_send_receive_message_rn.md b/en-US/markdown/agora-chat/Develop/Messages/Send and Receive Messages/agora_chat_send_receive_message_rn.md index e0b92aac6c3..8b1ee7024fb 100644 --- a/en-US/markdown/agora-chat/Develop/Messages/Send and Receive Messages/agora_chat_send_receive_message_rn.md +++ b/en-US/markdown/agora-chat/Develop/Messages/Send and Receive Messages/agora_chat_send_receive_message_rn.md @@ -3,7 +3,6 @@ After logging in to Agora Chat, users can send the following types of messages t - Attachment messages, including image, voice, video, and file messages. - Location messages. - CMD messages. -- Extended messages. - Custom messages. In high-concurrency scenarios, you can set a certain message type or messages from a chat room member as high, normal, or low. In this case, low-priority messages are dropped first to reserve resources for the high-priority ones (e.g. gifts and announcements) when the server is overloaded. This ensures that the high-priority messages can be dealt with first when loads of messages are being sent in high concurrency or high frequency. Note that this feature can increase the delivery reliability of high-priority messages, but cannot guarantee the deliveries. Even high-priorities messages can be dropped when the server load goes too high. @@ -12,7 +11,7 @@ This page shows how to implement sending and receiving these messages using the ## Understand the tech -The Agora Chat SDK uses the `ChatMessage` and `ChatMessage` classes to send, receive, and withdraw messages. +The Agora Chat SDK uses the `ChatManager` and `ChatMessage` classes to send, receive, and withdraw messages. The process of sending and receiving a message is as follows: @@ -206,7 +205,7 @@ class ChatMessageEvent implements ChatMessageEventListener { console.log(`onConversationRead: `, from, to); } } -// Listen for the mesage event. +// Listen for the message event. const listener = new ChatMessageEvent(); ChatClient.getInstance().chatManager.addMessageListener(listener); // Remove the specified message listener. diff --git a/en-US/markdown/agora-chat/Develop/Messages/Send and Receive Messages/agora_chat_send_receive_message_unity.md b/en-US/markdown/agora-chat/Develop/Messages/Send and Receive Messages/agora_chat_send_receive_message_unity.md index 3cff075f22d..2de78cc1465 100644 --- a/en-US/markdown/agora-chat/Develop/Messages/Send and Receive Messages/agora_chat_send_receive_message_unity.md +++ b/en-US/markdown/agora-chat/Develop/Messages/Send and Receive Messages/agora_chat_send_receive_message_unity.md @@ -3,7 +3,6 @@ After logging in to Agora Chat, users can send the following types of messages t - Attachment messages, including image, voice, video, and file messages. - Location messages. - CMD messages. -- Extended messages. - Custom messages. In high-concurrency scenarios, you can set a certain message type or messages from a chat room member as high, normal, or low. In this case, low-priority messages are dropped first to reserve resources for the high-priority ones (e.g. gifts and announcements) when the server is overloaded. This ensures that the high-priority messages can be dealt with first when loads of messages are being sent in high concurrency or high frequency. Note that this feature can increase the delivery reliability of high-priority messages, but cannot guarantee the deliveries. Even high-priorities messages can be dropped when the server load goes too high. @@ -18,7 +17,7 @@ The process of sending and receiving a message is as follows: 1. The message sender creates a text, file, or attachment message using the corresponding `Create` method. 2. The message sender calls `SendMessage` to send the message. -3. The message recipient calls `AddChatManagerDelegate` to listens for message events and receives the message in the `OnMessageReceived` callback. +3. The message recipient calls `AddChatManagerDelegate` to listen for message events and receive the message in the `OnMessageReceived` callback. ## Prerequistes @@ -42,7 +41,7 @@ Message msg = Message.CreateTextSendMessage(conversationId, content); // Set `MessageType` in `Message` as `Chat`, `Group`, or `Room` for one-to-one chat, group chat, or room chat. msg.MessageType = MessageType.Group; -// Set the priority of chat room messages. The default priority is `Normal`, indicating the normal priority. +// Set the priority of chat room messages. The default priority is `RoomMessagePriority.Normal`, indicating the normal priority. // msg.MessageType = MessageType.Room; // msg.SetRoomMessagePriority(RoomMessagePriority.High); @@ -113,7 +112,7 @@ void OnMessagesRecalled(List messages); ### Send and receive an attachment message -Voice, image, video, and file messages are issentially attachment messages. This section introduces how to send these types of messages. +Voice, image, video, and file messages are essentially attachment messages. This section introduces how to send these types of messages. #### Send and receive a voice message @@ -163,14 +162,14 @@ else { #### Send and receive an image message -By default, the SDK compresses the image file before sending it. To send the originial file, you can set `original` as `true`. +By default, the SDK compresses the image file before sending it. To send the original file, you can set `original` as `true`. Refer to the following code example to create and send an image message: ```C# // Create SendMessage to send the image message. // Set `localPath` as the path of the image file on the local device, `displayName` as the display name of the message, `fileSize` as the size of the image file, `width` as the width (in pixels) of the thumbnail, and `height` as the height (in pixels) of the thumbnail. -// `orignial` indicates whether to send the original image file. The default value is `false`. By default, the SDK compresses image files the exceeds 100 KB and sends the thumbnail. To send the originial image, set this parameter as `true`. +// `original` indicates whether to send the original image file. The default value is `false`. By default, the SDK compresses image files that exceeds 100 KB and sends the thumbnail. To send the original image, set this parameter as `true`. Message msg = Message.CreateImageSendMessage(toChatUsername,localPath, displayName, fileSize, original, width , height); // Set the message type using the `MessageType` attribute in `Message`. // You can set `MessageType` as `Chat`, `Group`, or `Room`, which indicates whether to send the message to a peer user, a chat group, or a chat room. @@ -244,7 +243,7 @@ If you do not want the SDK to automatically download the video thumbnail, set `O To download the actual video file, call `SDKClient.Instance.ChatManager.DownloadAttachment`, and get the path of the video file from the `LocalPath` member in `msg.Body`. ```C# -// When the recipent receives a video message, the SDK downloads and then open the video file. +// When the recipient receives a video message, the SDK downloads and then open the video file. SDKClient.Instance.ChatManager.DownloadAttachment("Message ID", new CallBack( onSuccess: () => { Debug.Log($"Attachment download succeeds."); @@ -350,7 +349,7 @@ SDKClient.Instance.ChatManager.SendMessage(ref msg, new CallBack( )); ``` -To notify the recipient that a CMD message is received, use a seperate delegate so that users can deal with the message differently. +To notify the recipient that a CMD message is received, use a separate delegate so that users can deal with the message differently. ```C# // Inherit and instantiate `IChatManagerDelegate`. @@ -373,8 +372,6 @@ SDKClient.Instance.ChatManager.AddChatManagerDelegate(adelegate); ### Send a customized message -Custom messages are self-defined key-value pairs that include the message type and the message content. - The following code example shows how to create and send a customized message: ```C# diff --git a/en-US/markdown/agora-chat/Develop/Messages/Send and Receive Messages/agora_chat_send_receive_message_web.md b/en-US/markdown/agora-chat/Develop/Messages/Send and Receive Messages/agora_chat_send_receive_message_web.md index 22b21ef782d..61856382f8e 100644 --- a/en-US/markdown/agora-chat/Develop/Messages/Send and Receive Messages/agora_chat_send_receive_message_web.md +++ b/en-US/markdown/agora-chat/Develop/Messages/Send and Receive Messages/agora_chat_send_receive_message_web.md @@ -92,9 +92,9 @@ When a message arrives, the recipient receives an `onXXXMessage` callback. Each // Use `addEventHandler` to listen for callback events. connection.addEventHandler("eventName",{ // Occurs when the app is connected. - onOpened: function (message) {}, + onConnected: function (message) {}, // Occurs when the connection is lost. - onClosed: function (message) {}, + onDisconnected: function (message) {}, // Occurs when the text message is received. onTextMessage: function (message) {}, // Occurs when the image message is received. @@ -174,7 +174,7 @@ connection.addEventHandler('MESSAGES',{ Voice, image, video, and file messages are essentially attachment messages. When sending an attachment message, the SDK takes the following steps: -1. Uploads the attachment to the server and gets the information of the attachment file on the server +1. Uploads the attachment to the server and gets the information of the attachment file on the server. 2. Sends the attachment message, which contains the basic information of the message, and the path to the attachment file on the server. For the attachment messages, you can upload the attachment to your server, instead of the Agora server, before sending an attachment message. In this case, you need to set the `useOwnUploadFun` parameter in the `connection` class to `true` during SDK initialization. For example, to send an image message, you can call `sendPrivateUrlImg` to pass in the image URL after uploading the image attachment. diff --git a/en-US/markdown/agora-chat/Develop/Messages/Send and Receive Messages/agora_chat_send_receive_message_windows.md b/en-US/markdown/agora-chat/Develop/Messages/Send and Receive Messages/agora_chat_send_receive_message_windows.md index 44d40f394be..71b7a20966b 100644 --- a/en-US/markdown/agora-chat/Develop/Messages/Send and Receive Messages/agora_chat_send_receive_message_windows.md +++ b/en-US/markdown/agora-chat/Develop/Messages/Send and Receive Messages/agora_chat_send_receive_message_windows.md @@ -373,8 +373,6 @@ SDKClient.Instance.ChatManager.AddChatManagerDelegate(adelegate); ### Send a customized message -Custom messages are self-defined key-value pairs that include the message type and the message content. - The following code example shows how to create and send a customized message: ```C#