SDK 公开面与文档覆盖
本页回答一个具体问题:这个平台导出的每个公开方法、事件、枚举与数据类型,在文档中心的哪一页被说明?页面由 SDK 制品公开面(api-surface 快照)与 IDL 绑定声明生成,逐项给出签名与文档位置;差异(多余/缺失的方法)如实标注,不做静默补齐。
契约(IDL 语义操作)是语义权威:方法名、参数、返回、错误码、示例都以功能页为准。
制品快照用于确认该平台是否真的导出了该方法;快照与实现不一致时,页面标注差异而不是猜测。
本页只做索引与核对,不重复功能页的参数表与示例。
来源与口径
| 项 | 内容 |
|---|---|
| 制品公开面 | 已读取该平台的 api-surface 快照(103 个公开方法) |
| 契约语义 | IDL 1.0.0 的 103 个语义操作 + 16 个事件 |
| 绑定签名 | 来自 IDL 绑定声明的方法签名(各平台语言风格) |
| 口径说明 | 制品公开面快照的方法表为 91 项,比 IDL 的 102 个语义操作少 11 项(推送令牌与超级群频道/用户组);这些方法已在 SDK 中实现,快照未同步。页面以 IDL 语义为准,并在此标注快照差异。 |
覆盖摘要
| 类别 | 数量 | 文档承载位置 |
|---|---|---|
| IDL 语义操作 | 103 | 功能页(每操作:说明 + 参数表 + 返回值 + 错误码 + 示例) |
| 绑定便捷方法 | 0 | — |
| 事件 | 16 | 本页事件表 + 连接监听 |
| 枚举 / 常量 | 4 | API 参考「枚举」各页 |
| 数据类型 | 58 | API 参考「类」各页 + 方法参数/返回值表 |
公开方法索引
下表逐项列出本平台导出的公开方法(IDL 语义操作在前,绑定便捷方法在后),并给出承载页面。功能页内的每个操作都有独立的参数表、返回值、错误码与可运行示例。
| 方法 | 本平台签名 / 形态 | 文档位置 |
|---|---|---|
init | RCIMIWEngine.create(String appKey, RCIMIWEngineOptions options) | 建立连接 |
connect | connect(String token, int timeout, {RCIMIWConnectCallback? callback}) | 建立连接 |
disconnect | disconnect(bool receivePush) | 建立连接 |
getConnectionStatus | getConnectionStatus() | 建立连接 |
getCurrentUserId | getCurrentUserId() | 连接监听 |
addEventListener | addEventListener(String event, void Function(Object?) handler) | 连接监听 |
removeEventListener | removeEventListener(String event, void Function(Object?) handler) | 连接监听 |
sendMessage | sendMessage(int conversationType, String targetId, MessageContent content, {MessageOptions? options}) | 发送消息 |
sendTextMessage | sendTextMessage(int conversationType, String targetId, String text, {MessageOptions? options}) | 发送消息 |
sendImageMessage | sendImageMessage(int conversationType, String targetId, ImageContent content, {MessageOptions? options}) | 发送消息 |
sendFileMessage | sendFileMessage(int conversationType, String targetId, FileContent content, {MessageOptions? options}) | 发送消息 |
sendVoiceMessage | sendVoiceMessage(int conversationType, String targetId, VoiceContent content, {MessageOptions? options}) | 发送消息 |
sendLocationMessage | sendLocationMessage(int conversationType, String targetId, LocationContent content, {MessageOptions? options}) | 发送消息 |
sendTypingStatus | sendTypingStatus(int conversationType, String targetId, bool typing) | 输入状态 |
recallMessage | recallMessage(String messageId) | 消息管理 |
sendReadReceipt | sendReadReceipt(int conversationType, String targetId, List<String> messageIds) | 已读回执 |
getMessageReadCount | getMessageReadCount(String messageId) | 已读回执 |
getMessageReadUsers | getMessageReadUsers(String messageId, {int offset, int limit}) | 已读回执 |
getMessageReadDetail | getMessageReadDetail(String messageId, {int offset, int limit, String? filter}) | API 参考索引 |
searchMessages | searchMessages({required String keyword, int limit}) | 消息管理 |
getConversationList | getConversationList() | 会话列表 |
getConversation | getConversation(int conversationType, String targetId) | 会话列表 |
getHistoryMessages | getHistoryMessages(int conversationType, String targetId, {int limit, int? beforeSeq, String? channelId}) | 历史消息 |
clearUnreadCount | clearUnreadCount(int conversationType, String targetId) | 未读数 |
setConversationToTop | setConversationToTop(int conversationType, String targetId, bool isTop) | 置顶与免打扰 |
saveTextMessageDraft | saveTextMessageDraft(int conversationType, String targetId, String draft) | 草稿 |
getTextMessageDraft | getTextMessageDraft(int conversationType, String targetId) | 草稿 |
clearTextMessageDraft | clearTextMessageDraft(int conversationType, String targetId) | 草稿 |
setConversationNotificationLevel | setConversationNotificationLevel(int conversationType, String targetId, int level) | 置顶与免打扰 |
getUserProfile | getUserProfile(String userId) | 用户资料 |
updateMyUserProfile | updateMyUserProfile({String? name, String? avatarUrl}) | 用户资料 |
getOnlineStatus | getOnlineStatus(String userId) | 在线状态 |
getOnlineStatusBatch | getOnlineStatusBatch(List<String> userIds) | 在线状态 |
searchUsers | searchUsers(String keyword, {int limit}) | 好友列表 |
sendFriendRequest | sendFriendRequest(String toUserId, {String? message}) | 好友请求 |
getFriendRequests | getFriendRequests({String? type, String? status}) | 好友请求 |
acceptFriendRequest | acceptFriendRequest(String requestId) | 好友请求 |
rejectFriendRequest | rejectFriendRequest(String requestId) | 好友请求 |
getFriends | getFriends() | 好友列表 |
deleteFriend | deleteFriend(String friendId) | 好友列表 |
setFriendRemark | setFriendRemark(String friendId, String remark) | 好友列表 |
getBlacklist | getBlacklist() | 黑名单 |
addToBlacklist | addToBlacklist(String userId) | 黑名单 |
removeFromBlacklist | removeFromBlacklist(String userId) | 黑名单 |
createGroup | createGroup(String name, List<String> memberIds, {String? groupId, String? owner, GroupOptions? options}) | 创建群组 |
getGroupsInfo | getGroupsInfo(List<String> groupIds) | 创建群组 |
getGroupMembers | getGroupMembers(String groupId) | 群成员 |
addGroupMembers | addGroupMembers(String groupId, List<String> userIds) | 群成员 |
removeGroupMembers | removeGroupMembers(String groupId, List<String> userIds) | 群成员 |
quitGroup | quitGroup(String groupId) | 群成员 |
updateGroupName | updateGroupName(String groupId, String name) | 群管理 |
updateGroupNotice | updateGroupNotice(String groupId, String notice) | 群管理 |
transferGroupOwner | transferGroupOwner(String groupId, String newOwner) | 群管理 |
addGroupAdmin | addGroupAdmin(String groupId, String userId) | 群管理 |
removeGroupAdmin | removeGroupAdmin(String groupId, String userId) | 群管理 |
muteGroupMember | muteGroupMember(String groupId, String userId, int mutedUntil) | 群管理 |
createChatroom | createChatroom({String? chatroomId, required String name, String? owner}) | 加入与退出 |
joinChatroom | joinChatroom(String chatroomId) | 加入与退出 |
leaveChatroom | leaveChatroom(String chatroomId) | 加入与退出 |
getChatroomInfo | getChatroomInfo(String chatroomId) | 聊天室信息 |
getChatroomMembers | getChatroomMembers(String chatroomId, {int offset, int limit}) | 聊天室信息 |
getSystemMessages | getSystemMessages({int limit, int? beforeSeq}) | 系统通知 |
uploadFile | uploadFile(List<int> data, String name, {String? mime}) | 文件上传 |
updateMessageExpansion | updateMessageExpansion(String messageId, Map<String, String> expansion) | 消息进阶 |
removeMessageExpansion | removeMessageExpansion(String messageId, List<String> keys) | 消息进阶 |
addMessageReaction | addMessageReaction(int conversationType, String targetId, String messageId, String reactionId) | 消息进阶 |
removeMessageReaction | removeMessageReaction(int conversationType, String targetId, String messageId, String reactionId) | 消息进阶 |
batchGetMessageReactionSummaries | batchGetMessageReactionSummaries(int conversationType, String targetId, List<String> messageIds) | 消息进阶 |
getMessageReactions | getMessageReactions(int conversationType, String targetId, String messageId, {int? count, String? pageToken}) | 消息进阶 |
getMessageReactionUsers | getMessageReactionUsers(int conversationType, String targetId, String messageId, String reactionId, {int? count, String? pageToken}) | 消息进阶 |
createConversationTag | createConversationTag(String tagName, {CreateConversationTagOptions? options}) | 会话标签与分组 |
updateConversationTag | updateConversationTag(String tagId, String tagName) | 会话标签与分组 |
deleteConversationTag | deleteConversationTag(String tagId) | 会话标签与分组 |
getConversationTags | getConversationTags() | 会话标签与分组 |
addConversationsToTag | addConversationsToTag(String tagId, List<ConversationRef> conversations) | 会话标签与分组 |
removeConversationsFromTag | removeConversationsFromTag(String tagId, List<ConversationRef> conversations) | 会话标签与分组 |
getConversationsFromTagByPage | getConversationsFromTagByPage(String tagId, {ConversationTagPageOptions? options}) | 会话标签与分组 |
getTagsFromConversation | getTagsFromConversation(int conversationType, String targetId) | 会话标签与分组 |
getUnreadCountByTag | getUnreadCountByTag(String tagId) | 会话标签与分组 |
setConversationToTopInTag | setConversationToTopInTag(String tagId, int conversationType, String targetId, bool top) | 会话标签与分组 |
deleteConversation | deleteConversation(int conversationType, String targetId) | 会话删除与类型免打扰 |
getConversationTypeNotification | getConversationTypeNotification(int conversationType) | 会话删除与类型免打扰 |
setConversationTypeNotification | setConversationTypeNotification(int conversationType, int level) | 会话删除与类型免打扰 |
startStreamMessage | startStreamMessage(int conversationType, String targetId, {StartStreamMessageOptions? options}) | 消息进阶 |
appendStreamMessage | appendStreamMessage(String streamId, String delta, {AppendStreamMessageOptions? options}) | 消息进阶 |
completeStreamMessage | completeStreamMessage(String streamId) | 消息进阶 |
getStreamMessage | getStreamMessage(String streamId) | 消息进阶 |
getMessageExpansion | getMessageExpansion(String messageId) | 消息进阶 |
combineMessages | combineMessages(List<Message> messages, {CombineMessagesOptions? options}) | 消息进阶 |
subscribePresence | subscribePresence(List<String> userIds) | 在线状态订阅与推送令牌 |
unsubscribePresence | unsubscribePresence(List<String> userIds) | 在线状态订阅与推送令牌 |
getPresenceSubscriptions | getPresenceSubscriptions() | 在线状态订阅与推送令牌 |
registerPushToken | registerPushToken(RegisterPushTokenOptions options) | 在线状态订阅与推送令牌 |
unregisterPushToken | unregisterPushToken(String tokenId) | 在线状态订阅与推送令牌 |
getPushTokens | getPushTokens() | 在线状态订阅与推送令牌 |
createSupergroupChannel | createSupergroupChannel(CreateSupergroupChannelParams params) | 超级群频道与用户组 |
listSupergroupChannels | listSupergroupChannels(String groupId) | 超级群频道与用户组 |
joinSupergroupChannel | joinSupergroupChannel(String channelId, {SupergroupChannelOptions? options}) | 超级群频道与用户组 |
leaveSupergroupChannel | leaveSupergroupChannel(String channelId, {SupergroupChannelOptions? options}) | 超级群频道与用户组 |
bindUserGroupToChannel | bindUserGroupToChannel(String channelId, String userGroupId, {SupergroupChannelOptions? options}) | 超级群频道与用户组 |
createUserGroup | createUserGroup(CreateUserGroupParams params) | 超级群频道与用户组 |
listUserGroups | listUserGroups(String groupId) | 超级群频道与用户组 |
getUserGroupsByUser | getUserGroupsByUser(String userId, {SupergroupChannelOptions? options}) | 超级群频道与用户组 |
事件索引
事件名在所有 GA 平台一致(Web 为小写下划线常量值,原生平台为枚举成员)。事件订阅方式见连接监听页;载荷字段来自 IDL 事件定义。
| 事件 | 载荷 | 本平台导出 | 文档位置 |
|---|---|---|---|
CONNECTING | {attempt:int} | 是 | API 参考 · 事件载荷 |
CONNECTED | {userId:string, sessionId?:string} | 是 | API 参考 · 事件载荷 |
DISCONNECT | {code:int, reason:string} | 是 | API 参考 · 事件载荷 |
SUSPEND | {code:int, reason:string} | 是 | API 参考 · 事件载荷 |
MESSAGES | {messages:Message[]} | 是 | API 参考 · 事件载荷 |
CONVERSATION | {conversation:Conversation} | 是 | API 参考 · 事件载荷 |
MESSAGE_RECALLED | {message:Message} | 是 | API 参考 · 事件载荷 |
READ_RECEIPT | ReadReceipt | 是 | API 参考 · 事件载荷 |
TYPING | {conversationType:ConversationType,targetId:string,userId:string,typing:bool,timestamp:int64} | 是 | API 参考 · 事件载荷 |
MESSAGE_REACTION_CHANGED | {messageId:string,conversationType:ConversationType,targetId:string,reactionId:string,operation:added|removed|cleared,userId:string,reactionTime:int64,totalCount:uint32,users:string[]?} | 是 | API 参考 · 事件载荷 |
MESSAGE_EXPANSION_CHANGED | {messageId:string,conversationType:ConversationType,targetId:string,updated:Record<string,string>?,removed:string[]?,timestamp:int64} | 是 | API 参考 · 事件载荷 |
STREAM_MESSAGE_CHANGED | {streamId:string,messageId:string,conversationType:ConversationType,targetId:string,senderId:string,delta:string,seq:uint32,text:string,status:streaming|ended,complete:bool,timestamp:int64} | 是 | API 参考 · 事件载荷 |
PRESENCE_CHANGED | {userId:string,online:bool,lastSeenAt:int64,timestamp:int64,reason:connect|disconnect|kick|deactivate} | 是 | API 参考 · 事件载荷 |
FRIEND_EVENT | {kind:FriendEventKind,request?:FriendRequest,fromUserId?:string,toUserId?:string,timestamp:int64} | 是 | API 参考 · 事件载荷 |
CHATROOM_EVENT | {chatroomId:string,kind:ChatroomEventKind,userId?:string,onlineCount?:uint32,chatroom?:Chatroom,timestamp:int64} | 是 | API 参考 · 事件载荷 |
KICKED | {code:int,reason:string} | 是 | API 参考 · 事件载荷 |
枚举与常量索引
枚举取值在 API 参考的「枚举」页逐项列出(名称、取值、语义),错误码另有状态码页。
| 常量 / 枚举 | 取值数 | 文档位置 |
|---|---|---|
RongIMConversationType | — | 枚举 · conversation-type |
RongIMConnectionStatus | — | 枚举 · connection-status |
RongIMErrorCode | — | 枚举 · error-code |
CONTENT_TYPE_COMBINE | — | 状态码与错误处理 |
数据类型索引
公开数据类型分两类:有独立页面的核心结构(消息、会话、群组、内容联合体等),以及只作为参数/返回结构出现的选项与结果对象(字段在对应方法的参数表与返回值中说明)。
| 类型 | 文档位置 |
|---|---|
Chatroom | 数据结构 · Chatroom |
ChatroomMember | 数据结构 · ChatroomMember |
ConnectionStatus | 枚举 · ConnectionStatus |
Conversation | 数据结构 · Conversation |
ConversationType | 枚举 · ConversationType |
Friend | 数据结构 · Friend |
FriendRequest | 数据结构 · FriendRequest |
Group | 数据结构 · Group |
GroupMember | 数据结构 · GroupMember |
GroupType | 枚举 · GroupType |
Message | 数据结构 · Message |
NotificationLevel | 枚举 · NotificationLevel |
UserProfile | 数据结构 · UserProfile |
随方法说明的类型
ChannelType、CombineContent、Config、Content、ConversationRef、ConversationTag、ConversationTagConversation、Conversations、Count、Counts、CurrentUserReacted、GroupId、Groups、IMClient、Id、Ids、Inactive、Indexed、Info、JoinPolicy、Joined、MaxChars、Member、Members、MentionedInfo、MessageReadDetailItem、More、Ms、MsgId、Names、Policy、PushToken、Quote、ReactionSummary、Seq、StreamMessage、SupergroupChannel、Time、Token、Total、Type、Until、Url、UserGroup、Version
平台导出的类型与包符号
制品公开面还导出 19 个平台类型/包符号(选项对象、回调、传输层与结果结构);IDL 语义面之外的符号在对应方法的参数表与返回值中说明,或由包内的类型声明提供。
RCIMIWEngine、RCIMIWEngineOptions、RCIMIWErrorCode、RCIMIWUnsupportedException、GroupOptions、IMClientOptions、ImStore、ImStoreFormatException、ImStoreMigration、ImStoreWriteException、MemoryImStore、imStoreSchemaVersion、ImStoreBackend、SharedPrefsImStore、SharedPreferencesImStoreBackend、defaultImStoreMigrations、migrateImStoreV0ToV1、RcResult、RongIMNotInitializedException