From 7f104d249bba7d6d04fa64afe3a189b97d6cce40 Mon Sep 17 00:00:00 2001 From: haoxiuwen Date: Thu, 19 Jun 2025 09:41:14 +0800 Subject: [PATCH] Modify Message Sending and Receiving --- docs/README.md | 115 ++++++++++++++++++-- docs/document/harmonyos/message_target.md | 2 +- docs/document/harmonyos/releasenote.md | 3 +- docs/document/ios/elite_sdk.md | 2 +- docs/document/ios/message_forward.md | 4 +- docs/document/ios/releasenote.md | 12 +- docs/document/windows/releasenote.md | 4 +- docs/document/windows/thread_message.md | 2 +- docs/product/circle/channel_mgmt_android.md | 2 +- docs/product/faq_quality_issues.md | 2 +- docs/product/product_dynamics.md | 4 +- 11 files changed, 123 insertions(+), 29 deletions(-) diff --git a/docs/README.md b/docs/README.md index 391a6dd1e..4d2aa65fa 100644 --- a/docs/README.md +++ b/docs/README.md @@ -112,42 +112,75 @@ projects: - title: 消息和会话 icon: /feature/message.svg contexts: - - text: 发送/接收消息 - desc: 在单聊、群聊和聊天室中发送和接收各种类型的消息,包括文本消息、图片、语音、视频、文件消息、位置消息、透传消息、自定义消息、合并消息和定向消息。 + - text: 发送消息 + desc: 在单聊、群聊和聊天室中发送各种类型的消息,包括文本消息、图片、语音、视频、文件消息、位置消息、透传消息、自定义消息、合并消息。 sdks: - icon: /sdk/android.svg text: Android - link: /document/android/message_send_receive.html + link: /document/android/message_send.html - icon: /sdk/iOS.svg text: iOS - link: /document/ios/message_send_receive.html + link: /document/ios/message_send.html - icon: /sdk/web.svg text: Web - link: /document/web/message_send_receive.html + link: /document/web/message_send.html - icon: /sdk/applet.svg text: 小程序 - link: /document/applet/message_send_receive.html + link: /document/applet/message_send.html - icon: /sdk/harmonyos.svg text: HarmonyOS - link: /document/harmonyos/message_send_receive.html + link: /document/harmonyos/message_send.html - icon: /sdk/flutter.svg text: Flutter - link: /document/flutter/message_send_receive.html + link: /document/flutter/message_send.html - icon: /sdk/react.svg text: React Native - link: /document/react-native/message_send_receive.html + link: /document/react-native/message_send.html - icon: /sdk/unity.svg text: Unity - link: /document/unity/message_send_receive.html + link: /document/unity/message_send.html - icon: /sdk/windows.svg text: Windows - link: /document/windows/message_send_receive.html + link: /document/windows/message_send.html - icon: /sdk/electron.svg text: Electron link: /document/electron/message.html#发送消息 - icon: /sdk/rest.svg text: REST link: /document/server-side/message_single.html + - text: 接收消息 + desc: 在单聊、群聊和聊天室中接收各种类型的消息,包括文本消息、图片、语音、视频、文件消息、位置消息、透传消息、自定义消息、合并消息。 + sdks: + - icon: /sdk/android.svg + text: Android + link: /document/android/message_receive.html + - icon: /sdk/iOS.svg + text: iOS + link: /document/ios/message_receive.html + - icon: /sdk/web.svg + text: Web + link: /document/web/message_receive.html + - icon: /sdk/applet.svg + text: 小程序 + link: /document/applet/message_receive.html + - icon: /sdk/harmonyos.svg + text: HarmonyOS + link: /document/harmonyos/message_receive.html + - icon: /sdk/flutter.svg + text: Flutter + link: /document/flutter/message_receive.html + - icon: /sdk/react.svg + text: React Native + link: /document/react-native/message_receive.html + - icon: /sdk/unity.svg + text: Unity + link: /document/unity/message_receive.html + - icon: /sdk/windows.svg + text: Windows + link: /document/windows/message_receive.html + - icon: /sdk/electron.svg + text: Electron + link: /document/electron/message.html#接收消息 - text: 获取消息 desc: 从环信消息服务器获取漫游消息,或者从本地获取消息。 sdks: @@ -463,6 +496,66 @@ projects: - icon: /sdk/rest.svg text: REST link: /document/server-side/message_delete.html + - text: 定向消息 + desc: 发送定向消息是指向群组或聊天室的单个或多个指定的成员发送消息,其他成员不会收到该消息。 + sdks: + - icon: /sdk/android.svg + text: Android + link: /document/android/message_target.html + - icon: /sdk/iOS.svg + text: iOS + link: /document/ios/message_target.html + - icon: /sdk/web.svg + text: Web + link: /document/web/message_target.html + - icon: /sdk/applet.svg + text: 小程序 + link: /document/applet/message_target.html + - icon: /sdk/harmonyos.svg + text: HarmonyOS + link: /document/harmonyos/message_target.html + - icon: /sdk/flutter.svg + text: Flutter + link: /document/flutter/message_target.html + - icon: /sdk/react.svg + text: React Native + link: /document/react-native/message_target.html + - icon: /sdk/unity.svg + text: Unity + link: /document/unity/message_target.html + - icon: /sdk/windows.svg + text: Windows + link: /document/windows/message_target.html + - text: 消息扩展 + desc: 当 SDK 提供的消息类型不满足需求时,你可以通过消息扩展字段传递自定义的内容,从而生成自己需要的消息类型。 + sdks: + - icon: /sdk/android.svg + text: Android + link: /document/android/message_extension.html + - icon: /sdk/iOS.svg + text: iOS + link: /document/ios/message_extension.html + - icon: /sdk/web.svg + text: Web + link: /document/web/message_extension.html + - icon: /sdk/applet.svg + text: 小程序 + link: /document/applet/message_extension.html + - icon: /sdk/harmonyos.svg + text: HarmonyOS + link: /document/harmonyos/message_extension.html + - icon: /sdk/flutter.svg + text: Flutter + link: /document/flutter/message_extension.html + - icon: /sdk/react.svg + text: React Native + link: /document/react-native/message_extension.html + - icon: /sdk/unity.svg + text: Unity + link: /document/unity/message_extension.html + - icon: /sdk/windows.svg + text: Windows + link: /document/windows/message_extension.html - text: 置顶消息 desc: 将会话中的消息固定在会话顶部,方便会话中的所有用户快速查看重要消息。 sdks: diff --git a/docs/document/harmonyos/message_target.md b/docs/document/harmonyos/message_target.md index 14868b4aa..9ffc41319 100644 --- a/docs/document/harmonyos/message_target.md +++ b/docs/document/harmonyos/message_target.md @@ -29,4 +29,4 @@ message.setReceiverList(receives); ChatClient.getInstance().chatManager()?.sendMessage(message); ``` -接收群定向消息与接收普通消息的操作相同,详见[接收消息](#发送和接收文本消息)。 \ No newline at end of file +接收群定向消息与接收普通消息的操作相同,详见[接收消息](message_receive.html)。 \ No newline at end of file diff --git a/docs/document/harmonyos/releasenote.md b/docs/document/harmonyos/releasenote.md index 21dc69b5e..a83547e95 100644 --- a/docs/document/harmonyos/releasenote.md +++ b/docs/document/harmonyos/releasenote.md @@ -259,7 +259,8 @@ 环信即时通讯 HarmonyOS SDK 支持单聊、群组聊天和聊天室聊天场景,实现了以下特性: - 支持消息特性: - - [发送和接收消息](message_send_receive.html); + - [发送消息](message_send.html); + - [接收消息](message_receive.html); - [获取历史消息](message_retrieve.html); - [撤回消息](message_recall.html); - [消息回执](message_receipt.html); diff --git a/docs/document/ios/elite_sdk.md b/docs/document/ios/elite_sdk.md index 28d74a96f..a33c461ab 100644 --- a/docs/document/ios/elite_sdk.md +++ b/docs/document/ios/elite_sdk.md @@ -28,7 +28,7 @@ 消息管理 发送和接收消息 发送和接收消息 -

发送和接收消息

+

发送和接收消息

✅ ✅ diff --git a/docs/document/ios/message_forward.md b/docs/document/ios/message_forward.md index 1c0c44046..cae2cc82a 100644 --- a/docs/document/ios/message_forward.md +++ b/docs/document/ios/message_forward.md @@ -9,7 +9,7 @@ 环信即时通讯 IM iOS SDK 通过 `EMChatMessage` 和 `ChatManager` 类实现消息的转发。 - 转发单条消息:创建一条与原消息完全相同的消息,调用 `EMChatManager#sendMessage` 方法转发消息。 -- 转发多条消息:通过[发送合并消息](message_send_receive.html#发送和接收合并消息)实现。 +- 转发多条消息:通过[发送合并消息](message_send.html#发送合并消息)实现。 ## 前提条件 @@ -45,7 +45,7 @@ if let message = EMClient.shared().chatManager?.getMessageWithMessageId("message ### 转发多条消息 -对于转发多条消息,环信即时通讯 IM 支持将多个消息合并在一起进行转发,详见[发送合并消息](message_send_receive.html#发送和接收合并消息)。 +对于转发多条消息,环信即时通讯 IM 支持将多个消息合并在一起进行转发,详见[发送合并消息](message_send.html#发送合并消息)。 diff --git a/docs/document/ios/releasenote.md b/docs/document/ios/releasenote.md index 3187da444..74692c73a 100644 --- a/docs/document/ios/releasenote.md +++ b/docs/document/ios/releasenote.md @@ -19,9 +19,9 @@ ### 新增特性 -- 支持 [GIF 图片消息](message_send_receive.html#发送和接收-gif-图片消息)。 +- 支持 [发送](message_send.html#发送-gif-图片消息) 和[接收 GIF 图片消息](message_receive.html#接收-gif-图片消息)。 - 支持 [群组头像功能](group_attributes.html#管理群组头像)。 -- 支持 [消息附件鉴权功能](message_send_receive.html#发送和接收附件消息)。该功能需要联系商务开通,开通后必须调用 SDK 的 API 才能下载消息附件。 +- 支持 [消息附件鉴权功能](message_receive.html#接收附件消息)。该功能需要联系商务开通,开通后必须调用 SDK 的 API 才能下载消息附件。 - 支持拉取漫游消息时,只 [拉取指定的群成员发送的消息](message_retrieve.html#从服务器获取指定群成员发送的消息)。 - 支持加载本地会话消息时,[只加载指定群成员发送的消息](message_retrieve.html#从本地获取指定群成员发送的消息)。 - 支持 [获取群成员列表](group_manage.html#获取群成员列表) 时包括成员角色和入群时间。 @@ -120,7 +120,7 @@ ### 优化 -- [IM SDK] [发送前回调](/document/server-side/callback_presending.html)时修改的[消息扩展字段](/document/android/message_send_receive.html#使用消息扩展字段),会同步到发送方。 +- [IM SDK] [发送前回调](/document/server-side/callback_presending.html)时修改的[消息扩展字段](/document/android/message_extension.html),会同步到发送方。 - [IM SDK] 调用[删除服务端会话 API](conversation_delete.html#单向删除服务端会话及其历史消息),成功后会删除本地会话。之前版本调用该接口可设置删除会话的本地消息,不能删除本地会话。 - [IM SDK] 群组和聊天室操作的默认错误码提示由 `EMErrorGroupMembersFull`(604)和 `EMErrorChatroomMembersFull`(704)调整为 `EMErrorGroupPermissionDenied`(603)和 `EMErrorChatroomPermissionDeniedD`(703)。例如,群组普通成员设置群组管理员时,由于缺乏权限,会提示 603 错误。 @@ -278,8 +278,8 @@ - [IM SDK] 新增 [EMChatManager#deleteAllMessagesAndConversations:completion:](message_delete.html#清空聊天记录) 方法,用于清空当前用户的聊天记录,包括消息和会话,同时可以选择是否清除服务端的聊天记录。 - [IM SDK] 新增 [EMChatManager#loadMessagesWithKeyword:timestamp:count:fromUser:searchDirection:scope:completion:](message_search.html#根据搜索范围搜索所有会话中的消息) 和[EMConversation#loadMessagesWithKeyword:timestamp:count:fromUser:searchDirection:scope:completion:](message_search.html#根据搜索范围搜索当前会话中的消息),可以在根据关键字搜索消息时,选择搜索范围,如只搜索消息内容、只搜索消息扩展信息以及同时搜索消息内容以及扩展信息。 -- [IM SDK] 新增 [EMOptions#useReplacedMessageContents](message_send_receive.html#发送消息前的内容审核) 开关。开启后,发送消息时如果被内容审核进行了内容替换,发送方可以获取替换后的内容。 -- [IM SDK] 新增 [EMOptions#includeSendMessageInMessageListener](message_send_receive.html#发送和接收文本消息) 开关。开启后,在 `messagesDidReceive` 回调里增加发送成功的消息。 +- [IM SDK] 新增 [EMOptions#useReplacedMessageContents](message_send.html#发送消息前的内容审核) 开关。开启后,发送消息时如果被内容审核进行了内容替换,发送方可以获取替换后的内容。 +- [IM SDK] 新增 [EMOptions#includeSendMessageInMessageListener](message_send.html#发送文本消息) 开关。开启后,在 `messagesDidReceive` 回调里增加发送成功的消息。 - [IM SDK] 新增 [EMOptions#regardImportMessagesAsRead](message_retrieve.html#从服务器获取指定会话的消息) 开关。开启后,[利用服务端接口](/document/server-side/message_import.html)导入的消息,客户端上通过[漫游拉取](message_retrieve.html#从服务器获取指定会话的消息)到后,这些消息为已读状态,会话中未读取的消息数量 `EMConversation#unreadMessagesCount` 不发生变化。若该开关为关闭状态,`EMConversation#unreadMessagesCount` 的数量会增加。 ### 优化 @@ -347,7 +347,7 @@ ### 新增特性 -- [IM SDK] 新增[合并转发消息功能](message_send_receive.html#发送和接收合并消息): +- [IM SDK] 新增 [发送](message_send_.html#发送合并消息)和 [接收合并转发消息](message_receive.html#接收合并消息) 功能: - 新增合并消息类型 `EMMessageBodyTypeCombine`; - 新增消息体类 `EMCombineMessageBody` ; - 新增 `EMChatManager#downloadAndParseCombineMessage` 方法,用于下载并解析合并消息。 diff --git a/docs/document/windows/releasenote.md b/docs/document/windows/releasenote.md index f1a0457b3..6bd2c221e 100644 --- a/docs/document/windows/releasenote.md +++ b/docs/document/windows/releasenote.md @@ -169,7 +169,7 @@ - `FetchServerMessagesOption#StartTime`:消息查询的起始时间; - `FetchServerMessagesOption#EndTime`:消息查询的结束时间。 - [IM SDK] 新增 `GetConversationsFromServerWithCursor` 方法从[服务端分页获取会话列表](conversation_list.html#从服务器分页获取会话列表)。 -- [IM SDK] 新增[在群组或聊天室中发送定向消息功能](message_send_receive.html#发送和接收定向消息): +- [IM SDK] 新增[在群组或聊天室中发送定向消息功能](message_target.html): - `Message#ReceiverList`:设置群组或聊天室消息接收列表。 - [IM SDK] 新增删除本地数据库中指定时间段的消息: - `Conversation#DeleteMessages`:删除本地数据库中指定时间段的消息。 @@ -327,7 +327,7 @@ - [开通配置环信即时通讯 IM 服务](/product/enable_and_configure_IM.html) - [环信即时通讯 IM Windows 快速入门](quickstart.html) -- [消息管理 Windows](message_send_receive.html) +- [消息管理 Windows](message_send.html) - [群组 Windows](group_manage.html) - [聊天室 Windows](room_manage.html) - [Windows API Reference](apireference.html) \ No newline at end of file diff --git a/docs/document/windows/thread_message.md b/docs/document/windows/thread_message.md index 831dc4801..a623082f0 100644 --- a/docs/document/windows/thread_message.md +++ b/docs/document/windows/thread_message.md @@ -32,7 +32,7 @@ ### 发送子区消息 -发送子区消息和发送群组消息的方法基本一致,详情请参考 [发送消息](message_send_receive.html#发送和接收文本消息)。唯一不同的是,发送子区消息需要指定标记 `IsThread` 为 `true`。 +发送子区消息和发送群组消息的方法基本一致,详情请参考 [发送消息](message_send.html)。唯一不同的是,发送子区消息需要指定标记 `IsThread` 为 `true`。 示例代码如下: diff --git a/docs/product/circle/channel_mgmt_android.md b/docs/product/circle/channel_mgmt_android.md index b609e7e33..4f402affc 100644 --- a/docs/product/circle/channel_mgmt_android.md +++ b/docs/product/circle/channel_mgmt_android.md @@ -295,7 +295,7 @@ EMClient.getInstance().chatCircleManager().fetchPrivateChannelsInCategory(server ### 发送消息 -在频道中发送消息与在群组中发送消息的方式类似,唯一的区别在于接收方需要设置为频道 ID。详见 [发送群聊消息](/document/android/message_send_receive.html)。 +在频道中发送消息与在群组中发送消息的方式类似,唯一的区别在于接收方需要设置为频道 ID。详见 [发送群聊消息](/document/android/message_send.html)。 ### 管理频道成员 diff --git a/docs/product/faq_quality_issues.md b/docs/product/faq_quality_issues.md index f898bd53d..283f92801 100644 --- a/docs/product/faq_quality_issues.md +++ b/docs/product/faq_quality_issues.md @@ -52,7 +52,7 @@ #### 一、App 未上线时,使用环信即时通讯 IM SDK 集成阶段测试用户出现消息丢失 - 用户 B 在线的情况下收不到用户 A 发的群组消息: - 1. 检查用户 A 在构建消息时,传的消息类型是不是群聊类型的,如果不是则用户 B 收不到用户 A 发的群组消息,详见 [Android 版构建消息](/document/android/message_send_receive.html#发送和接收文本消息) 或 [iOS 版构建消息](/document/ios/message_send_receive.html#发送和接收文本消息)。 + 1. 检查用户 A 在构建消息时,传的消息类型是不是群聊类型的,如果不是则用户 B 收不到用户 A 发的群组消息,详见 [Android 版构建消息](/document/android/message_send.html#发送文本消息) 或 [iOS 版构建消息](/document/ios/message_send.html#发送文本消息)。 2. 检查用户 A 发送的消息是否成功,可以根据 SDK 发消息方法返回的结果判断消息是否发送成功,如果发送失败,则用户 B 收不到用户 A 发送的群组消息。 3. 检查用户 A 给用户 B 发消息时,传的群组 ID 是否正确(是否为 A 与 B 共同加入的群组 ID),如果传的不是正确的群组 ID,那么用户 B 收不到消息用户 A 发的群组消息。 4. 检查用户 B 是否在群组中,可以获取群组详情,看群组中是否有用户 B,详见 [获取群组详情](/document/server-side/group_manage.html#获取群组详情)。 diff --git a/docs/product/product_dynamics.md b/docs/product/product_dynamics.md index c81ee38e3..22ff1c0bf 100644 --- a/docs/product/product_dynamics.md +++ b/docs/product/product_dynamics.md @@ -18,7 +18,7 @@ | 动态名称 | 动态描述 | 发布时间 | 相关文档 | | :----- | :------- | :---------------- | :---------------- | -| Flutter SDK 4.15.0 版本发布 |
- 支持 [GIF 图片消息](/document/flutter/message_send_receive.html#发送和接收-gif-图片消息)。
- 支持 [群组头像功能](/document/flutter/group_attributes.html#管理群组头像)。
- 支持 [消息附件鉴权功能](/document/flutter/message_send_receive.html#发送和接收附件消息)。该功能需要联系商务开通,开通后必须调用 SDK 的 API 才能下载消息附件。
- 支持拉取漫游消息时,[只拉取指定的群成员发送的消息](/document/flutter/message_retrieve.html#从服务器获取指定群成员发送的消息)。
- 支持加载本地会话消息时,[只加载指定群成员发送的消息](/document/flutter/message_retrieve.html#从本地获取指定群成员发送的消息)。
- 支持 [获取群成员列表](/document/flutter/group_manage.html#获取群成员列表) 时除了用户 ID 还包括成员角色和加群时间。 | 2025-06-13 | [Flutter 4.15.0 更新日志](/document/flutter/releasenote.html#版本-v4-15-0-dev-2025-6-16-开发版) | +| Flutter SDK 4.15.0 版本发布 |
- 支持 [GIF 图片消息](/document/flutter/message_send.html#发送-gif-图片消息)。
- 支持 [群组头像功能](/document/flutter/group_attributes.html#管理群组头像)。
- 支持 [消息附件鉴权功能](/document/flutter/message_receive.html#接收附件消息)。该功能需要联系商务开通,开通后必须调用 SDK 的 API 才能下载消息附件。
- 支持拉取漫游消息时,[只拉取指定的群成员发送的消息](/document/flutter/message_retrieve.html#从服务器获取指定群成员发送的消息)。
- 支持加载本地会话消息时,[只加载指定群成员发送的消息](/document/flutter/message_retrieve.html#从本地获取指定群成员发送的消息)。
- 支持 [获取群成员列表](/document/flutter/group_manage.html#获取群成员列表) 时除了用户 ID 还包括成员角色和加群时间。 | 2025-06-13 | [Flutter 4.15.0 更新日志](/document/flutter/releasenote.html#版本-v4-15-0-dev-2025-6-16-开发版) | ## 2025-05 @@ -32,7 +32,7 @@ | 动态名称 | 动态描述 | 发布时间 | 相关文档 | | :----- | :------- | :---------------- | :---------------- | -| HarmonyOS SDK 1.7.0 开发版发布 |
- 支持 [GIF 图片消息](/document/harmonyos/message_send_receive.html#发送和接收-gif-图片消息)。
- 支持 [群组头像功能](/document/harmonyos/group_attributes.html#管理群组头像)。
- 支持 [消息附件鉴权功能](/document/harmonyos/message_send_receive.html#发送和接收附件消息)。该功能需要联系商务开通,开通后必须调用 SDK 的 API 才能下载消息附件。
- 支持拉取漫游消息时,[只拉取指定的群成员发送的消息](/document/harmonyos/message_retrieve.html#从服务器获取指定群成员发送的消息)。
- 支持加载本地会话消息时,[只加载指定群成员发送的消息](/document/harmonyos/message_retrieve.html#从本地获取指定群成员发送的消息)。
- 支持 [根据搜索范围搜索所有会话中的消息](/document/harmonyos/message_search.html#根据搜索范围搜索所有会话中的消息) 和 [单个会话中的消息](/document/harmonyos/message_search.html#根据搜索范围搜索当前会话中的消息):可以根据关键字搜索消息时,选择搜索范围,如只搜索消息内容、只搜索消息扩展信息以及同时搜索消息内容以及扩展信息。 | 2025-05-15 | [HarmonyOS 1.7.0 更新日志](/document/harmonyos/releasenote.html#版本-v1-7-0-dev-2025-5-15-开发版) | +| HarmonyOS SDK 1.7.0 开发版发布 |
- 支持 [发送](/document/harmonyos/message_send.html#发送-gif-图片消息) 和 [接收 GIF 图片消息](/document/harmonyos/message_send.html#接收-gif-图片消息)。
- 支持 [群组头像功能](/document/harmonyos/group_attributes.html#管理群组头像)。
- 支持 [消息附件鉴权功能](/document/harmonyos/message_send_receive.html#发送和接收附件消息)。该功能需要联系商务开通,开通后必须调用 SDK 的 API 才能下载消息附件。
- 支持拉取漫游消息时,[只拉取指定的群成员发送的消息](/document/harmonyos/message_retrieve.html#从服务器获取指定群成员发送的消息)。
- 支持加载本地会话消息时,[只加载指定群成员发送的消息](/document/harmonyos/message_retrieve.html#从本地获取指定群成员发送的消息)。
- 支持 [根据搜索范围搜索所有会话中的消息](/document/harmonyos/message_search.html#根据搜索范围搜索所有会话中的消息) 和 [单个会话中的消息](/document/harmonyos/message_search.html#根据搜索范围搜索当前会话中的消息):可以根据关键字搜索消息时,选择搜索范围,如只搜索消息内容、只搜索消息扩展信息以及同时搜索消息内容以及扩展信息。 | 2025-05-15 | [HarmonyOS 1.7.0 更新日志](/document/harmonyos/releasenote.html#版本-v1-7-0-dev-2025-5-15-开发版) | ## 2025-04