跳到主要内容

版本:2.X

显示用户信息

提示

单群聊中用户信息需要开发者自行处理。SDK 不处理用户信息。

历史消息显示用户信息​

通过开发者 App Server 获取用户信息

  1. 开发者 App Server 封装获取用户信息接口
  2. 通过 message.senderUserId 获取发送者 id
  3. 将发送者 id 传入 App Server 暴露的接口中, 获取对应用户信息
  4. 将用户信息展示到页面中
plantuml
!theme materia
skinparam sequence {
ArrowFontSize 13
ParticipantFontSize 11
}
IMSDK -> App: 返回历史消息列表
App --> IMSDK: 调用获取历史消息方法
App --> AppServer: 通过消息的 message.senderUserId 获取发送者用户信息
AppServer -> App: 返回用户信息,进行展示

会话列表显示用户信息​

通过开发者 App Server 获取用户信息

  1. 开发者 App Server 封装获取用户或群组信息接口
  2. 通过 conversation.targetId 获取用户或者群组 id
  3. 将用户或者群组 id 传入 App Server 暴露的接口中, 获取对应用户或群组信息
  4. 将信息展示到页面中
plantuml
!theme materia
skinparam sequence {
ArrowFontSize 13
ParticipantFontSize 11
}
IMSDK -> App: 返回历史消息列表
App --> IMSDK: 调用获取历史消息方法
App --> AppServer: 通过消息的 conversation.targetId 获取发送者用户信息
AppServer -> App: 返回用户或者群组信息,进行展示