聊天室信息

获取聊天室资料与在线成员列表;成员数不设上限。

平台调用风格

异步风格:Future<RcResult<T>>;错误码在 res.code,不使用异常表达业务失败。

接口一览​

操作语义传输返回
getChatroomInfo聊天室信息(含在线数)。REST(客户端)Chatroom
getChatroomMembers聊天室在线成员列表。REST(客户端){members:ChatroomMember[], total:uint32}

本页 2 个操作,其中 2 个在本平台绑定中声明了方法签名。

跨端方法名​

操作AndroidWebElectronmacOSFlutterNative (C ABI)iOS
getChatroomInfogetChatroomInfogetChatroomInfogetChatroomInfogetChatroomInfogetChatroomInfoim_client_chatroom_infofunc
getChatroomMembersgetChatroomMembersgetChatroomMembersgetChatroomMembersgetChatroomMembersgetChatroomMembers—func

方法名在 GA 平台之间保持一致(规则 A);Native C ABI 只覆盖部分操作,其余操作以 — 标注。

getChatroomInfo​

聊天室信息(含在线数)。

getChatroomInfo(String chatroomId)
REST(客户端)since 1.0.0
参数
参数类型说明
chatroomIdstring必填;聊天室 ID
返回

Chatroom 聊天室资料

示例
Dart
final res = await engine.getChatroomInfo('cr_2001');
if (res.code != 0) throw Exception(res.msg);
错误码
错误码名称分类HTTP可重试说明
1001INVALID_PARAMETER客户端 / 参数 / 权限400否参数错误
1012CHATROOM_NOT_FOUND客户端 / 参数 / 权限404否聊天室不存在

getChatroomMembers​

聊天室在线成员列表。

getChatroomMembers(String chatroomId, {int offset, int limit})
REST(客户端)since 1.0.0
参数
参数类型说明
chatroomIdstring必填;聊天室 ID
options{offset?:uint32,limit?:uint32}可选;选项对象(字段见类型列):{ offset?:uint32, limit?:uint32 }
返回

{members:ChatroomMember[], total:uint32} 在线成员页与总数

示例
Dart
final res = await engine.getChatroomMembers('cr_2001');
if (res.code != 0) throw Exception(res.msg);
错误码
错误码名称分类HTTP可重试说明
1001INVALID_PARAMETER客户端 / 参数 / 权限400否参数错误
1012CHATROOM_NOT_FOUND客户端 / 参数 / 权限404否聊天室不存在

相关文档​