Skip to content

Commit

Permalink
Merge pull request #1092 from haoxiuwen/doc-v2
Browse files Browse the repository at this point in the history
Add Conversation Read Receipt for Harmony, RN, Flutter, and Unity/Windows
  • Loading branch information
haoxiuwen authored Dec 18, 2024
2 parents 7693f13 + 3d79bb8 commit dd29eaa
Show file tree
Hide file tree
Showing 114 changed files with 4,068 additions and 1,281 deletions.
161 changes: 94 additions & 67 deletions docs/.vuepress/sidebar/document.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,6 @@ const documentSidebar = [
{ text: 'Demo(EaseIM App)体验', link: 'demo.html', except: ['web', 'windows', 'react-native', 'flutter', 'unity', 'server-side'] },
{ text: '快速开始', link: 'quickstart.html', except: ['windows', 'react-native', 'flutter', 'unity', 'server-side'] },
{ text: '快速开始', link: 'quickstart.html', only: ['windows', 'react-native', 'flutter', 'unity'] },
{ text: '按需导入 SDK(推荐)', link: 'import_sdk_minicore.html', only: ['web'] },
{ text: 'SDK 集成概述', link: 'overview.html', only: ['android', 'ios', 'web', 'harmonyos', 'flutter'] },
{ text: 'SDK 集成概述', link: 'overview.html', only: ['windows', 'react-native', 'unity'] },
// { text: '私有云 SDK 集成配置', link: 'privatecloud.html', except: ['windows', 'server-side', 'react-native', 'flutter', 'unity'] },
{ text: 'SDK 更新日志', link: 'releasenote.html', except: ['server-side']},
/*{ text: 'API reference', link: 'apireference.html', only: ['android', 'ios', 'web', 'windows', 'react-native', 'flutter', 'unity']},*/
Expand All @@ -40,8 +37,19 @@ const documentSidebar = [
except: ['applet', 'electron','linux']
},
{
text: '基础功能',
text: '用户指南',
children: [
{ text: '集成 SDK', link: 'integration.html' },
{ text: '初始化', link: 'initialization.html' },
{
text: '登录',
collapsible: true,
children: [
{ text: '登录介绍', link: 'login.html' },
{ text: '连接', link: 'connection.html' },
{ text: '多设备登录', link: 'multi_device.html' },
]
},
{
text: '消息管理',
collapsible: true,
Expand All @@ -53,13 +61,15 @@ const documentSidebar = [
{ text: '搜索消息', link: 'message_search.html', except: ['web', 'harmonyos']},
{ text: '消息回执', link: 'message_receipt.html'},
{ text: '修改消息', link: 'message_modify.html'},
{ text: '消息表情回复', link: 'reaction.html' },
{ text: '转发消息', link: 'message_forward.html', except: ['web']},
{ text: '导入和插入消息', link: 'message_import_insert.html', except: ['web']},
{ text: '更新消息', link: 'message_update.html', except: ['web']},
{ text: '删除消息', link: 'message_delete.html' },
{ text: '置顶消息', link: 'message_pin.html', except: ['harmonyos']},
{ text: '翻译消息', link: 'message_translation.html', except: ['harmonyos']},
{ text: '只投在线用户', link: 'message_deliver_only_online.html'},
{ text: '消息审核(举报)', link: 'moderation.html', except: ['harmonyos']},
{ text: '获取消息流量统计', link: 'message_traffic_statis.html', only: ['android', 'ios'] },
]
},
Expand All @@ -70,15 +80,13 @@ const documentSidebar = [
{ text: '会话介绍', link: 'conversation_overview.html' },
{ text: '会话列表', link: 'conversation_list.html' },
{ text: '本地会话', link: 'conversation_local.html', only: ['web'] },
{ text: '会话已读回执', link: 'conversation_receipt.html', only: ['android', 'ios', 'web'] },
{ text: '会话已读回执', link: 'conversation_receipt.html' },
{ text: '会话未读数', link: 'conversation_unread.html', except: ['web'] },
{ text: '置顶会话', link: 'conversation_pin.html' },
{ text: '会话标记', link: 'conversation_mark.html' },
{ text: '删除会话', link: 'conversation_delete.html' },
]
},
{ text: '管理用户属性', link: 'userprofile.html' },
{ text: '管理用户关系', link: 'user_relationship.html' },
{
text: '群组管理',
collapsible: true,
Expand All @@ -87,6 +95,8 @@ const documentSidebar = [
{ text: '创建和管理群组', link: 'group_manage.html' },
{ text: '管理群组成员', link: 'group_members.html' },
{ text: '管理群组属性', link: 'group_attributes.html' },
{ text: '管理子区', link: 'thread.html', except: ['harmonyos'] },
{ text: '管理子区消息', link: 'thread_message.html', except: ['harmonyos'] }
]
},
{
Expand All @@ -99,13 +109,16 @@ const documentSidebar = [
{ text: '管理聊天室属性', link: 'room_attributes.html' },
]
},
],
except: ['applet', 'server-side', 'electron','linux']
},
{
text: '进阶功能',
children: [
{
{
text: '用户相关',
collapsible: true,
children: [
{ text: '用户关系', link: 'user_relationship.html' },
{ text: '用户属性', link: 'userprofile.html' },
{ text: '在线状态订阅', link: 'message_retrieve.html' },
]
},
{
text: '离线推送',
collapsible: true,
children: [
Expand Down Expand Up @@ -139,33 +152,33 @@ const documentSidebar = [
{ text: 'FAQ', link: 'push/push_solution.html', only: ['android', 'ios','harmonyos']},
]
},
{ text: '登录多个设备', link: 'multi_device.html' },
{ text: '管理在线状态订阅', link: 'presence.html' },
{ text: '消息表情回复', link: 'reaction.html' },
{
text: '子区管理',
collapsible: true,
children: [
{ text: '管理子区', link: 'thread.html', except: ['harmonyos'] },
{ text: '管理子区消息', link: 'thread_message.html', except: ['harmonyos'] }
]
},
{ text: '消息审核(举报)', link: 'moderation.html', except: ['harmonyos']},
],
except: ['applet','server-side','electron','linux']
},
{
text: '其他',
text: '错误排查',
children: [
{ text: '错误码', link: 'error.html' },
//{ text: 'EaseIMKit 使用指南', link: 'easeimkit.html', except: ['web', 'windows', 'react-native', 'flutter', 'unity'] },
{ text: 'EaseCallKit 使用指南', link: 'easecallkit.html', except: ['web', 'windows', 'react-native', 'flutter', 'unity', 'harmonyos'] },
{ text: '日志', link: 'log.html', except: ['flutter'] },
],
except: ['applet', 'server-side','electron','linux']
},
{
text: 'CallKit 使用指南',
children: [
{ text: 'EaseCallKit 使用指南', link: 'easecallkit.html', only: ['android', 'ios'] },
{ text: 'CallKit 使用指南', link: 'easecallkit.html', only: ['web'] },
{ text: '苹果隐私策略', link: 'privacy_policy.html', only: ['ios'] },
],
except: ['applet', 'server-side','electron','linux']

},
{
text: '苹果隐私策略',
children: [
{ text: '苹果隐私策略', link: 'privacy_policy.html', only: ['ios'] },
],
except: ['applet', 'server-side','electron','linux']
},
{
text: '精简版 SDK',
children: [
Expand All @@ -182,22 +195,30 @@ const documentSidebar = [
only: ['applet']
},
{
text: '集成介绍',
text: '用户指南',
children: [
{ text: '微信小程序', link: 'wechat.html' },
{ text: 'QQ 小程序', link: 'qq.html' },
{ text: '百度小程序', link: 'baidu.html' },
{ text: '抖音小程序', link: 'bytedance.html' },
{ text: '支付宝小程序', link: 'alipay.html' },
{ text: 'Uniapp 全平台', link: 'uniapp.html' },
{ text: '小程序 API 文档', link: 'apidoc.html' },
],
only: ['applet']
},
{
text: '基本功能',
children: [
{ text: '初始化及登录', link: 'initialization.html' },
{
text: '集成介绍',
children: [
{ text: '微信小程序', link: 'wechat.html' },
{ text: 'QQ 小程序', link: 'qq.html' },
{ text: '百度小程序', link: 'baidu.html' },
{ text: '抖音小程序', link: 'bytedance.html' },
{ text: '支付宝小程序', link: 'alipay.html' },
{ text: 'Uniapp 全平台', link: 'uniapp.html' },
{ text: '小程序 API 文档', link: 'apidoc.html' },
],
},
{ text: '初始化', link: 'initialization.html' },
{
text: '登录',
collapsible: true,
children: [
{ text: '登录介绍', link: 'login.html' },
{ text: '连接', link: 'connection.html' },
{ text: '多设备登录', link: 'multi_device.html' },
],
},
{
text: '消息管理',
collapsible: true,
Expand All @@ -207,11 +228,13 @@ const documentSidebar = [
{ text: '获取历史消息', link: 'message_retrieve.html' },
{ text: '撤回消息', link: 'message_recall.html' },
{ text: '消息回执', link: 'message_receipt.html' },
{ text: '消息表情回复', link: 'reaction.html' },
{ text: '修改消息', link: 'message_modify.html' },
{ text: '删除消息', link: 'message_delete.html' },
{ text: '置顶消息', link: 'message_pin.html' },
{ text: '翻译消息', link: 'message_translation.html' },
{ text: '只投在线用户', link: 'message_deliver_only_online.html'},
{ text: '只投在线用户', link: 'message_deliver_only_online.html'},
{ text: '消息审核(举报)', link: 'moderation.html'},
]
},
{
Expand All @@ -226,8 +249,6 @@ const documentSidebar = [
{ text: '删除会话', link: 'conversation_delete.html'},
]
},
{ text: '管理用户属性', link: 'userprofile.html' },
{ text: '管理用户关系', link: 'user_relationship.html' },
{
text: '群组管理',
collapsible: true,
Expand All @@ -236,6 +257,14 @@ const documentSidebar = [
{ text: '创建和管理群组', link: 'group_manage.html' },
{ text: '管理群组成员', link: 'group_members.html' },
{ text: '管理群组属性', link: 'group_attributes.html' },
{
text: '子区管理',
collapsible: true,
children: [
{ text: '管理子区', link: 'thread.html' },
{ text: '管理子区消息', link: 'thread_message.html' }
]
},
]
},
{
Expand All @@ -248,12 +277,15 @@ const documentSidebar = [
{ text: '管理聊天室属性', link: 'room_attributes.html' },
]
},
],
only: ['applet']
},
{
text: '进阶功能',
children: [
{
text: '用户相关',
collapsible: true,
children: [
{ text: '用户关系', link: 'user_relationship.html' },
{ text: '用户属性', link: 'userprofile.html' },
{ text: '在线状态订阅', link: 'presence.html' },
]
},
{ text: '离线推送',
collapsible: true,
children: [
Expand All @@ -265,25 +297,20 @@ const documentSidebar = [
{ text: 'uni-app 离线推送', link: 'push/uniapp_push.html' }
]
},
{ text: '登录多个设备', link: 'multi_device.html' },
{ text: '管理在线状态订阅', link: 'presence.html' },
{ text: '消息表情回复', link: 'reaction.html' },
{
text: '子区管理',
collapsible: true,
children: [
{ text: '管理子区', link: 'thread.html' },
{ text: '管理子区消息', link: 'thread_message.html' }
]
},
{ text: '消息审核(举报)', link: 'moderation.html'},
],
only: ['applet']
},
{
text: '其他帮助',
text: '错误排查',
children: [
{ text: '错误码', link: 'error.html' },
{ text: '日志', link: 'log.html' },
],
only: ['applet']
},
{
text: '其他帮助',
children: [
{ text: 'Uniapp 生成原生 Android、iOS 应用', link: 'uniappnativeapp.html' },
{ text: '小程序模板使用指南', link: 'uniappuikit.html' },
{ text: '如何配置服务器域名', link: 'serverconfig.html' },
Expand Down
3 changes: 3 additions & 0 deletions docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,9 @@ starter:
- icon: /sdk/iOS.svg
link: /document/ios/easecallkit.html
text: iOS
- icon: /sdk/web.svg
link: /document/web/easecallkit.html
text: Web
projects:
- title: SDK/服务端功能
features:
Expand Down
67 changes: 67 additions & 0 deletions docs/document/android/connection.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
# 连接

应用客户端成功连接到环信服务器后,才能使用环信即时通讯 SDK 的收发消息等功能。

你调用 `loginWithToken``login` 方法登录后,客户端 SDK 会自动连接环信服务器。关于登录详情,请参见[登录文档](login.html)

## 监听连接状态

你可以通过注册连接监听确认连接状态。

```java
EMConnectionListener connectionListener = new EMConnectionListener() {
@Override
public void onConnected() {

}
@Override
public void onDisconnected(int errorCode) {

}

@Override
public void onLogout(int errorCode) {

}

@Override
public void onTokenWillExpire() {

}

@Override
public void onTokenExpired() {

}
// 连接成功,开始从服务器拉取离线消息时触发。
// 注意:如果本次登录服务器没有离线消息,不会触发该回调。
@Override
public void onOfflineMessageSyncStart() {

}
// 离线用户上线后从服务器拉取离线消息结束时触发。
// 注意:如果再拉取离线过程中因网络或其他原因导致连接断开,不会触发该回调。
@Override
public void onOfflineMessageSyncFinish() {

}
};
// 注册连接状态监听
EMClient.getInstance().addConnectionListener(connectionListener);
// 移除连接状态监听
EMClient.getInstance().removeConnectionListener(connectionListener);
```

## 自动重连

登录后,如果由于网络信号弱、切换网络等引起的连接中断,SDK 会自动尝试重连。重连成功或者失败时分别会收到 `onConnected``onDisconnected` 通知。

不过,SDK 在以下情况下会停止自动重连。你需要调用 `login` 方法登录。

- 用户调用了 SDK 的登出方法 `logout` 主动退出登录。
- 登录时鉴权错误,例如, token 无效(错误码 104)或已过期(错误码 108)。
- 用户在其他的设备上更改了密码,导致此设备上自动登录失败,提示错误码 216。
- 用户的账号被从服务器端删除,提示错误码 207。
- 用户在另一设备登录,将当前设备上登录的用户踢出,提示错误码 206。
- 用户登录设备数量超过限制,提示错误码 214。
- 应用程序的日活跃用户数量(DAU)或月活跃用户数量(MAU)达到上限,提示错误码 8。
7 changes: 7 additions & 0 deletions docs/document/android/conversation_receipt.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,13 @@
2. 消息接收方进入会话页面,阅读消息后,调用 `ackConversationRead` 方法发送会话已读回执。
3. 消息发送方通过监听 `OnConversationRead` 回调接收会话已读回执。

## 前提条件

开始前,请确保满足以下条件:

- 完成 SDK 初始化,并连接到服务器,详见 [快速开始](quickstart.html)
- 了解环信即时通讯 IM 的使用限制,详见 [使用限制](/product/limitation.html)

## 实现方法

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

0 comments on commit dd29eaa

Please sign in to comment.