怎么获取用户信息

由于融云不托管您的用户信息。所以如果您会话列表或者历史消息需要展示用户信息需要您通过 targetId 去您的用户表中查询相关信息

参考文档:http://doc.rongcloud.cn/im/Web/4.X/guide/user/uprovider/uprovider

历史消息显示用户信息

方式一: 通过开发者 App Server 获取用户信息

  1. 开发者 App Server 封装获取用户信息接口

  2. 通过 message.senderUserId 获取发送者 id

  3. 将发送者 id 传入 App Server 暴露的接口中, 获取对应用户信息

  4. 将用户信息展示到页面中

方式二: 通过发消息携带用户信息

  1. 获取当前用户(也就是发送者)的用户信息

  2. 发消息时携带当前用户信息

  3. 展示消息时, 通过消息体内的用户信息进行展示。