Skip to content

Commit ed1887f

Browse files
authored
Merge pull request #246 from skiffer-git/n4
add docs
2 parents 4a9ff4f + 3c76da5 commit ed1887f

File tree

2 files changed

+113
-1
lines changed

2 files changed

+113
-1
lines changed

docs/guides/solution/migrate.mdx

Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,73 @@ title: '如何从IM云服务迁移到OpenIM'
33
sidebar_position: 9
44

55
---
6+
7+
8+
9+
10+
在 OpenIM 系统中,一般会涉及以下几个关键数据存储:
11+
- **用户信息**
12+
- **好友关系**
13+
- **黑名单**
14+
- **群组**
15+
- **消息**
16+
- **会话**(通常可通过消息进行重建)
17+
18+
若您正准备从其他 IM 云服务迁移至 **OpenIM**,或需要将低版本的 OpenIM升级到更高版本(如从3.3升级到3.8,本文暂不包括 **Chat** 的迁移),可参照以下操作步骤进行数据导入与同步。
19+
20+
---
21+
22+
## 1. 导入用户
23+
24+
- **接口说明**[用户注册/导入](../../restapi/apis/userManagement/userRegister)
25+
- **操作目的**:将外部或历史系统中的用户信息导入到 OpenIM。
26+
27+
---
28+
29+
## 2. 导入好友关系
30+
31+
- **接口说明**[批量导入好友关系](../../restapi/apis/friendsManagement/importFriend)
32+
- **操作目的**:将外部或历史系统中的好有关系导入到 OpenIM。
33+
34+
---
35+
36+
## 3. 导入黑名单
37+
38+
- **接口说明**[添加到黑名单](../../restapi/apis/friendsManagement/addBlackList)
39+
- **操作目的**:将外部或历史系统中的黑名单导入到 OpenIM。
40+
41+
---
42+
43+
## 4. 创建群组
44+
45+
- **接口说明**[创建群组](../../restapi/apis/groupManagement/createGroup)
46+
- **操作目的**:将外部或历史系统中的群组导入到OpenIM。
47+
48+
---
49+
50+
## 5. 导入群成员
51+
52+
- **接口说明**[邀请用户进群](../../restapi/apis/groupManagement/inviteUserToGroup)
53+
- **操作目的**:将外部或历史系统中的群成员导入到 OpenIM。
54+
55+
---
56+
57+
## 6. 导入消息
58+
59+
- **接口说明**[发送消息接口](../../restapi/apis/messageManagement/sendMessage)
60+
- **重点关注**`sendTime` 字段
61+
- **操作目的**:将外部或历史系统中的历史消息导入到 OpenIM。 如果对OpenIM升级,需要自己解析历史消息,再通过此接口导入。
62+
63+
---
64+
65+
## 7. 设置会话状态
66+
67+
- **接口说明**[设置会话接口](../../restapi/apis/conversationManagement/setConversations)
68+
- **操作目的**:将外部或历史系统中的会话状态导入到 OpenIM。
69+
70+
---
71+
72+
以上操作完成后,OpenIM 系统就会拥有完整的用户信息、好友关系、黑名单、群组、消息以及会话状态,客户端SDK升级到对应的版本即可完成迁移。
73+
如需要同步好友备注,群组设置等,调用对应的REST API 即可。
74+
75+
Lines changed: 43 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,46 @@
11
---
22
title: '如何接入离线推送'
33
sidebar_position: 1
4-
---
4+
---
5+
6+
7+
8+
在移动端环境中,情况相对复杂:当用户不在线,或者 APP 被杀死、置于后台时,系统可能会挂起进程,导致 **OpenIM 长连接** 无法推送消息。为了确保消息能够及时触达用户,需要额外借助第三方推送服务:
9+
10+
- **中国境内环境** 推荐使用 [个推(GeTui)](https://www.getui.com/)
11+
- **中国境外环境** 推荐使用 [Firebase](https://firebase.google.com/)
12+
13+
14+
---
15+
16+
## 服务端与客户端的配置
17+
18+
对于使用 OpenIM 的开发者,需要在 **服务端****客户端** 进行对应的配置。
19+
20+
### 1. 服务端配置
21+
22+
以 YAML 格式为例,主要说明如何启用离线推送,以及个推(GeTui)、Firebase(FCM) 配置示例。
23+
24+
```yaml
25+
# 使用 GeTui 进行离线推送,也可选择 fcm 或 jpns;从对应的服务商获取相关配置,并配置。
26+
27+
enable: #选择 getui 或者 fcm
28+
getui:
29+
pushUrl: https://restapi.getui.com/v2/$appId
30+
masterSecret:
31+
appKey:
32+
intent:
33+
channelID:
34+
channelName:
35+
fcm:
36+
# 优先使用文件路径,若 filePath 为空,则使用 URL
37+
filePath: # filePath 相对 config目录的路径,如放在config目录则为./your-fcm-file.json
38+
authURL: # 必须以 https 或 http 开头
39+
```
40+
41+
### 2. 客户端配置
42+
43+
**Flutter 客户端** 的详细接入方式可参考下方链接:
44+
[OpenIM Flutter Demo 配置说明](https://github.com/openimsdk/openim-flutter-demo/blob/main/CONFIGKEY.zh-CN.md)
45+
46+

0 commit comments

Comments
 (0)