Skip to content

Commit dd29eaa

Browse files
authored
Merge pull request #1092 from haoxiuwen/doc-v2
Add Conversation Read Receipt for Harmony, RN, Flutter, and Unity/Windows
2 parents 7693f13 + 3d79bb8 commit dd29eaa

File tree

114 files changed

+4068
-1281
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

114 files changed

+4068
-1281
lines changed

docs/.vuepress/sidebar/document.ts

Lines changed: 94 additions & 67 deletions
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,6 @@ const documentSidebar = [
2525
{ text: 'Demo(EaseIM App)体验', link: 'demo.html', except: ['web', 'windows', 'react-native', 'flutter', 'unity', 'server-side'] },
2626
{ text: '快速开始', link: 'quickstart.html', except: ['windows', 'react-native', 'flutter', 'unity', 'server-side'] },
2727
{ text: '快速开始', link: 'quickstart.html', only: ['windows', 'react-native', 'flutter', 'unity'] },
28-
{ text: '按需导入 SDK(推荐)', link: 'import_sdk_minicore.html', only: ['web'] },
29-
{ text: 'SDK 集成概述', link: 'overview.html', only: ['android', 'ios', 'web', 'harmonyos', 'flutter'] },
30-
{ text: 'SDK 集成概述', link: 'overview.html', only: ['windows', 'react-native', 'unity'] },
3128
// { text: '私有云 SDK 集成配置', link: 'privatecloud.html', except: ['windows', 'server-side', 'react-native', 'flutter', 'unity'] },
3229
{ text: 'SDK 更新日志', link: 'releasenote.html', except: ['server-side']},
3330
/*{ text: 'API reference', link: 'apireference.html', only: ['android', 'ios', 'web', 'windows', 'react-native', 'flutter', 'unity']},*/
@@ -40,8 +37,19 @@ const documentSidebar = [
4037
except: ['applet', 'electron','linux']
4138
},
4239
{
43-
text: '基础功能',
40+
text: '用户指南',
4441
children: [
42+
{ text: '集成 SDK', link: 'integration.html' },
43+
{ text: '初始化', link: 'initialization.html' },
44+
{
45+
text: '登录',
46+
collapsible: true,
47+
children: [
48+
{ text: '登录介绍', link: 'login.html' },
49+
{ text: '连接', link: 'connection.html' },
50+
{ text: '多设备登录', link: 'multi_device.html' },
51+
]
52+
},
4553
{
4654
text: '消息管理',
4755
collapsible: true,
@@ -53,13 +61,15 @@ const documentSidebar = [
5361
{ text: '搜索消息', link: 'message_search.html', except: ['web', 'harmonyos']},
5462
{ text: '消息回执', link: 'message_receipt.html'},
5563
{ text: '修改消息', link: 'message_modify.html'},
64+
{ text: '消息表情回复', link: 'reaction.html' },
5665
{ text: '转发消息', link: 'message_forward.html', except: ['web']},
5766
{ text: '导入和插入消息', link: 'message_import_insert.html', except: ['web']},
5867
{ text: '更新消息', link: 'message_update.html', except: ['web']},
5968
{ text: '删除消息', link: 'message_delete.html' },
6069
{ text: '置顶消息', link: 'message_pin.html', except: ['harmonyos']},
6170
{ text: '翻译消息', link: 'message_translation.html', except: ['harmonyos']},
6271
{ text: '只投在线用户', link: 'message_deliver_only_online.html'},
72+
{ text: '消息审核(举报)', link: 'moderation.html', except: ['harmonyos']},
6373
{ text: '获取消息流量统计', link: 'message_traffic_statis.html', only: ['android', 'ios'] },
6474
]
6575
},
@@ -70,15 +80,13 @@ const documentSidebar = [
7080
{ text: '会话介绍', link: 'conversation_overview.html' },
7181
{ text: '会话列表', link: 'conversation_list.html' },
7282
{ text: '本地会话', link: 'conversation_local.html', only: ['web'] },
73-
{ text: '会话已读回执', link: 'conversation_receipt.html', only: ['android', 'ios', 'web'] },
83+
{ text: '会话已读回执', link: 'conversation_receipt.html' },
7484
{ text: '会话未读数', link: 'conversation_unread.html', except: ['web'] },
7585
{ text: '置顶会话', link: 'conversation_pin.html' },
7686
{ text: '会话标记', link: 'conversation_mark.html' },
7787
{ text: '删除会话', link: 'conversation_delete.html' },
7888
]
7989
},
80-
{ text: '管理用户属性', link: 'userprofile.html' },
81-
{ text: '管理用户关系', link: 'user_relationship.html' },
8290
{
8391
text: '群组管理',
8492
collapsible: true,
@@ -87,6 +95,8 @@ const documentSidebar = [
8795
{ text: '创建和管理群组', link: 'group_manage.html' },
8896
{ text: '管理群组成员', link: 'group_members.html' },
8997
{ text: '管理群组属性', link: 'group_attributes.html' },
98+
{ text: '管理子区', link: 'thread.html', except: ['harmonyos'] },
99+
{ text: '管理子区消息', link: 'thread_message.html', except: ['harmonyos'] }
90100
]
91101
},
92102
{
@@ -99,13 +109,16 @@ const documentSidebar = [
99109
{ text: '管理聊天室属性', link: 'room_attributes.html' },
100110
]
101111
},
102-
],
103-
except: ['applet', 'server-side', 'electron','linux']
104-
},
105-
{
106-
text: '进阶功能',
107-
children: [
108-
{
112+
{
113+
text: '用户相关',
114+
collapsible: true,
115+
children: [
116+
{ text: '用户关系', link: 'user_relationship.html' },
117+
{ text: '用户属性', link: 'userprofile.html' },
118+
{ text: '在线状态订阅', link: 'message_retrieve.html' },
119+
]
120+
},
121+
{
109122
text: '离线推送',
110123
collapsible: true,
111124
children: [
@@ -139,33 +152,33 @@ const documentSidebar = [
139152
{ text: 'FAQ', link: 'push/push_solution.html', only: ['android', 'ios','harmonyos']},
140153
]
141154
},
142-
{ text: '登录多个设备', link: 'multi_device.html' },
143-
{ text: '管理在线状态订阅', link: 'presence.html' },
144-
{ text: '消息表情回复', link: 'reaction.html' },
145-
{
146-
text: '子区管理',
147-
collapsible: true,
148-
children: [
149-
{ text: '管理子区', link: 'thread.html', except: ['harmonyos'] },
150-
{ text: '管理子区消息', link: 'thread_message.html', except: ['harmonyos'] }
151-
]
152-
},
153-
{ text: '消息审核(举报)', link: 'moderation.html', except: ['harmonyos']},
154155
],
155156
except: ['applet','server-side','electron','linux']
156157
},
157158
{
158-
text: '其他',
159+
text: '错误排查',
159160
children: [
160161
{ text: '错误码', link: 'error.html' },
161-
//{ text: 'EaseIMKit 使用指南', link: 'easeimkit.html', except: ['web', 'windows', 'react-native', 'flutter', 'unity'] },
162-
{ text: 'EaseCallKit 使用指南', link: 'easecallkit.html', except: ['web', 'windows', 'react-native', 'flutter', 'unity', 'harmonyos'] },
162+
{ text: '日志', link: 'log.html', except: ['flutter'] },
163+
],
164+
except: ['applet', 'server-side','electron','linux']
165+
},
166+
{
167+
text: 'CallKit 使用指南',
168+
children: [
169+
{ text: 'EaseCallKit 使用指南', link: 'easecallkit.html', only: ['android', 'ios'] },
163170
{ text: 'CallKit 使用指南', link: 'easecallkit.html', only: ['web'] },
164-
{ text: '苹果隐私策略', link: 'privacy_policy.html', only: ['ios'] },
165171
],
166172
except: ['applet', 'server-side','electron','linux']
167173

168174
},
175+
{
176+
text: '苹果隐私策略',
177+
children: [
178+
{ text: '苹果隐私策略', link: 'privacy_policy.html', only: ['ios'] },
179+
],
180+
except: ['applet', 'server-side','electron','linux']
181+
},
169182
{
170183
text: '精简版 SDK',
171184
children: [
@@ -182,22 +195,30 @@ const documentSidebar = [
182195
only: ['applet']
183196
},
184197
{
185-
text: '集成介绍',
198+
text: '用户指南',
186199
children: [
187-
{ text: '微信小程序', link: 'wechat.html' },
188-
{ text: 'QQ 小程序', link: 'qq.html' },
189-
{ text: '百度小程序', link: 'baidu.html' },
190-
{ text: '抖音小程序', link: 'bytedance.html' },
191-
{ text: '支付宝小程序', link: 'alipay.html' },
192-
{ text: 'Uniapp 全平台', link: 'uniapp.html' },
193-
{ text: '小程序 API 文档', link: 'apidoc.html' },
194-
],
195-
only: ['applet']
196-
},
197-
{
198-
text: '基本功能',
199-
children: [
200-
{ text: '初始化及登录', link: 'initialization.html' },
200+
{
201+
text: '集成介绍',
202+
children: [
203+
{ text: '微信小程序', link: 'wechat.html' },
204+
{ text: 'QQ 小程序', link: 'qq.html' },
205+
{ text: '百度小程序', link: 'baidu.html' },
206+
{ text: '抖音小程序', link: 'bytedance.html' },
207+
{ text: '支付宝小程序', link: 'alipay.html' },
208+
{ text: 'Uniapp 全平台', link: 'uniapp.html' },
209+
{ text: '小程序 API 文档', link: 'apidoc.html' },
210+
],
211+
},
212+
{ text: '初始化', link: 'initialization.html' },
213+
{
214+
text: '登录',
215+
collapsible: true,
216+
children: [
217+
{ text: '登录介绍', link: 'login.html' },
218+
{ text: '连接', link: 'connection.html' },
219+
{ text: '多设备登录', link: 'multi_device.html' },
220+
],
221+
},
201222
{
202223
text: '消息管理',
203224
collapsible: true,
@@ -207,11 +228,13 @@ const documentSidebar = [
207228
{ text: '获取历史消息', link: 'message_retrieve.html' },
208229
{ text: '撤回消息', link: 'message_recall.html' },
209230
{ text: '消息回执', link: 'message_receipt.html' },
231+
{ text: '消息表情回复', link: 'reaction.html' },
210232
{ text: '修改消息', link: 'message_modify.html' },
211233
{ text: '删除消息', link: 'message_delete.html' },
212234
{ text: '置顶消息', link: 'message_pin.html' },
213235
{ text: '翻译消息', link: 'message_translation.html' },
214-
{ text: '只投在线用户', link: 'message_deliver_only_online.html'},
236+
{ text: '只投在线用户', link: 'message_deliver_only_online.html'},
237+
{ text: '消息审核(举报)', link: 'moderation.html'},
215238
]
216239
},
217240
{
@@ -226,8 +249,6 @@ const documentSidebar = [
226249
{ text: '删除会话', link: 'conversation_delete.html'},
227250
]
228251
},
229-
{ text: '管理用户属性', link: 'userprofile.html' },
230-
{ text: '管理用户关系', link: 'user_relationship.html' },
231252
{
232253
text: '群组管理',
233254
collapsible: true,
@@ -236,6 +257,14 @@ const documentSidebar = [
236257
{ text: '创建和管理群组', link: 'group_manage.html' },
237258
{ text: '管理群组成员', link: 'group_members.html' },
238259
{ text: '管理群组属性', link: 'group_attributes.html' },
260+
{
261+
text: '子区管理',
262+
collapsible: true,
263+
children: [
264+
{ text: '管理子区', link: 'thread.html' },
265+
{ text: '管理子区消息', link: 'thread_message.html' }
266+
]
267+
},
239268
]
240269
},
241270
{
@@ -248,12 +277,15 @@ const documentSidebar = [
248277
{ text: '管理聊天室属性', link: 'room_attributes.html' },
249278
]
250279
},
251-
],
252-
only: ['applet']
253-
},
254-
{
255-
text: '进阶功能',
256-
children: [
280+
{
281+
text: '用户相关',
282+
collapsible: true,
283+
children: [
284+
{ text: '用户关系', link: 'user_relationship.html' },
285+
{ text: '用户属性', link: 'userprofile.html' },
286+
{ text: '在线状态订阅', link: 'presence.html' },
287+
]
288+
},
257289
{ text: '离线推送',
258290
collapsible: true,
259291
children: [
@@ -265,25 +297,20 @@ const documentSidebar = [
265297
{ text: 'uni-app 离线推送', link: 'push/uniapp_push.html' }
266298
]
267299
},
268-
{ text: '登录多个设备', link: 'multi_device.html' },
269-
{ text: '管理在线状态订阅', link: 'presence.html' },
270-
{ text: '消息表情回复', link: 'reaction.html' },
271-
{
272-
text: '子区管理',
273-
collapsible: true,
274-
children: [
275-
{ text: '管理子区', link: 'thread.html' },
276-
{ text: '管理子区消息', link: 'thread_message.html' }
277-
]
278-
},
279-
{ text: '消息审核(举报)', link: 'moderation.html'},
280300
],
281301
only: ['applet']
282302
},
283303
{
284-
text: '其他帮助',
304+
text: '错误排查',
285305
children: [
286306
{ text: '错误码', link: 'error.html' },
307+
{ text: '日志', link: 'log.html' },
308+
],
309+
only: ['applet']
310+
},
311+
{
312+
text: '其他帮助',
313+
children: [
287314
{ text: 'Uniapp 生成原生 Android、iOS 应用', link: 'uniappnativeapp.html' },
288315
{ text: '小程序模板使用指南', link: 'uniappuikit.html' },
289316
{ text: '如何配置服务器域名', link: 'serverconfig.html' },

docs/README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,9 @@ starter:
106106
- icon: /sdk/iOS.svg
107107
link: /document/ios/easecallkit.html
108108
text: iOS
109+
- icon: /sdk/web.svg
110+
link: /document/web/easecallkit.html
111+
text: Web
109112
projects:
110113
- title: SDK/服务端功能
111114
features:
Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
# 连接
2+
3+
应用客户端成功连接到环信服务器后,才能使用环信即时通讯 SDK 的收发消息等功能。
4+
5+
你调用 `loginWithToken``login` 方法登录后,客户端 SDK 会自动连接环信服务器。关于登录详情,请参见[登录文档](login.html)
6+
7+
## 监听连接状态
8+
9+
你可以通过注册连接监听确认连接状态。
10+
11+
```java
12+
EMConnectionListener connectionListener = new EMConnectionListener() {
13+
@Override
14+
public void onConnected() {
15+
16+
}
17+
@Override
18+
public void onDisconnected(int errorCode) {
19+
20+
}
21+
22+
@Override
23+
public void onLogout(int errorCode) {
24+
25+
}
26+
27+
@Override
28+
public void onTokenWillExpire() {
29+
30+
}
31+
32+
@Override
33+
public void onTokenExpired() {
34+
35+
}
36+
// 连接成功,开始从服务器拉取离线消息时触发。
37+
// 注意:如果本次登录服务器没有离线消息,不会触发该回调。
38+
@Override
39+
public void onOfflineMessageSyncStart() {
40+
41+
}
42+
// 离线用户上线后从服务器拉取离线消息结束时触发。
43+
// 注意:如果再拉取离线过程中因网络或其他原因导致连接断开,不会触发该回调。
44+
@Override
45+
public void onOfflineMessageSyncFinish() {
46+
47+
}
48+
};
49+
// 注册连接状态监听
50+
EMClient.getInstance().addConnectionListener(connectionListener);
51+
// 移除连接状态监听
52+
EMClient.getInstance().removeConnectionListener(connectionListener);
53+
```
54+
55+
## 自动重连
56+
57+
登录后,如果由于网络信号弱、切换网络等引起的连接中断,SDK 会自动尝试重连。重连成功或者失败时分别会收到 `onConnected``onDisconnected` 通知。
58+
59+
不过,SDK 在以下情况下会停止自动重连。你需要调用 `login` 方法登录。
60+
61+
- 用户调用了 SDK 的登出方法 `logout` 主动退出登录。
62+
- 登录时鉴权错误,例如, token 无效(错误码 104)或已过期(错误码 108)。
63+
- 用户在其他的设备上更改了密码,导致此设备上自动登录失败,提示错误码 216。
64+
- 用户的账号被从服务器端删除,提示错误码 207。
65+
- 用户在另一设备登录,将当前设备上登录的用户踢出,提示错误码 206。
66+
- 用户登录设备数量超过限制,提示错误码 214。
67+
- 应用程序的日活跃用户数量(DAU)或月活跃用户数量(MAU)达到上限,提示错误码 8。

docs/document/android/conversation_receipt.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,13 @@
1616
2. 消息接收方进入会话页面,阅读消息后,调用 `ackConversationRead` 方法发送会话已读回执。
1717
3. 消息发送方通过监听 `OnConversationRead` 回调接收会话已读回执。
1818

19+
## 前提条件
20+
21+
开始前,请确保满足以下条件:
22+
23+
- 完成 SDK 初始化,并连接到服务器,详见 [快速开始](quickstart.html)
24+
- 了解环信即时通讯 IM 的使用限制,详见 [使用限制](/product/limitation.html)
25+
1926
## 实现方法
2027

2128
参考以下步骤在单聊中实现会话已读回执:

0 commit comments

Comments
 (0)