SDK 公开面与文档覆盖

本页回答一个具体问题:这个平台导出的每个公开方法、事件、枚举与数据类型,在文档中心的哪一页被说明?页面由 SDK 制品公开面(api-surface 快照)与 IDL 绑定声明生成,逐项给出签名与文档位置;差异(多余/缺失的方法)如实标注,不做静默补齐。

口径

契约(IDL 语义操作)是语义权威:方法名、参数、返回、错误码、示例都以功能页为准。

制品快照用于确认该平台是否真的导出了该方法;快照与实现不一致时,页面标注差异而不是猜测。

本页只做索引与核对,不重复功能页的参数表与示例。

来源与口径​

项内容
制品公开面已读取该平台的 api-surface 快照(106 个公开方法)
契约语义IDL 1.0.0 的 103 个语义操作 + 16 个事件
绑定签名来自 IDL 绑定声明的方法签名(各平台语言风格)
口径说明制品公开面快照包含 106 个公开方法(102 个 IDL 语义操作 + 4 个绑定便捷方法)。

覆盖摘要​

类别数量文档承载位置
IDL 语义操作103功能页(每操作:说明 + 参数表 + 返回值 + 错误码 + 示例)
绑定便捷方法4本页「绑定便捷方法」小节
事件16本页事件表 + 连接监听
枚举 / 常量16API 参考「枚举」各页
数据类型58API 参考「类」各页 + 方法参数/返回值表
制品快照与实现的差异

制品方法表缺少 1 个已在实现中提供的方法:getMessageReadDetail。

这些方法的签名与语义以 IDL 绑定说明和功能页为准;差异会在 SDK 更新日志中同步修复。

公开方法索引​

下表逐项列出本平台导出的公开方法(IDL 语义操作在前,绑定便捷方法在后),并给出承载页面。功能页内的每个操作都有独立的参数表、返回值、错误码与可运行示例。

方法本平台签名 / 形态文档位置
initIMClient.init(context: Context, options: IMClientOptions): IMClient建立连接
connectfun connect(token: String, timeLimitSeconds: Int = 0, callback: ConnectCallback)建立连接
disconnectfun disconnect(receivePush: Boolean = true)建立连接
getConnectionStatusfun getConnectionStatus(): ConnectionStatus建立连接
getCurrentUserIdfun getCurrentUserId(): String连接监听
addEventListenerfun addEventListener(event: IMClientEvent, handler: EventHandler)连接监听
removeEventListenerfun removeEventListener(event: IMClientEvent, handler: EventHandler)连接监听
sendMessagefun sendMessage(conversationType: ConversationType, targetId: String, content: MessageContent, options: SendOptions? = null, callback: SendMessageCallback)发送消息
sendTextMessagefun sendTextMessage(conversationType: ConversationType, targetId: String, text: String, options: TextSendOptions? = null, callback: SendMessageCallback)发送消息
sendImageMessagefun sendImageMessage(conversationType: ConversationType, targetId: String, content: ImageContent, options: SendOptions? = null, callback: SendMessageCallback)发送消息
sendFileMessagefun sendFileMessage(conversationType: ConversationType, targetId: String, content: FileContent, options: SendOptions? = null, callback: SendMessageCallback)发送消息
sendVoiceMessagefun sendVoiceMessage(conversationType: ConversationType, targetId: String, content: VoiceContent, options: SendOptions? = null, callback: SendMessageCallback)发送消息
sendLocationMessagefun sendLocationMessage(conversationType: ConversationType, targetId: String, content: LocationContent, options: SendOptions? = null, callback: SendMessageCallback)发送消息
sendTypingStatusfun sendTypingStatus(conversationType: ConversationType, targetId: String, typing: Boolean, callback: OperationCallback? = null)输入状态
recallMessagefun recallMessage(messageId: String, options: RecallOptions? = null, callback: ResultCallback<Message>)消息管理
sendReadReceiptfun sendReadReceipt(conversationType: ConversationType, targetId: String, messageIds: List<String>, callback: ResultCallback<ReadReceiptResult>)已读回执
getMessageReadCountfun getMessageReadCount(messageId: String, callback: ResultCallback<MessageReadCount>)已读回执
getMessageReadUsersfun getMessageReadUsers(messageId: String, options: PageOptions? = null, callback: ResultCallback<MessageReadUsers>)已读回执
getMessageReadDetailgetMessageReadDetail(messageId: String, options: ReadDetailOptions? = null, callback: ResultCallback<MessageReadDetail>)API 参考索引
searchMessagesfun searchMessages(options: SearchMessagesOptions, callback: ResultCallback<MessageSearchResult>)消息管理
getConversationListfun getConversationList(callback: ResultCallback<List<Conversation>>)会话列表
getConversationfun getConversation(conversationType: ConversationType, targetId: String, callback: ResultCallback<Conversation>)会话列表
getHistoryMessagesfun getHistoryMessages(conversationType: ConversationType, targetId: String, options: HistoryOptions? = null, callback: ResultCallback<HistoryPage>)历史消息
clearUnreadCountfun clearUnreadCount(conversationType: ConversationType, targetId: String, callback: OperationCallback? = null)未读数
setConversationToTopfun setConversationToTop(conversationType: ConversationType, targetId: String, isTop: Boolean, callback: OperationCallback? = null)置顶与免打扰
saveTextMessageDraftfun saveTextMessageDraft(conversationType: ConversationType, targetId: String, draft: String, callback: OperationCallback? = null)草稿
getTextMessageDraftfun getTextMessageDraft(conversationType: ConversationType, targetId: String, callback: ResultCallback<String>)草稿
clearTextMessageDraftfun clearTextMessageDraft(conversationType: ConversationType, targetId: String, callback: OperationCallback? = null)草稿
setConversationNotificationLevelfun setConversationNotificationLevel(conversationType: ConversationType, targetId: String, level: NotificationLevel, callback: OperationCallback? = null)置顶与免打扰
getUserProfilefun getUserProfile(userId: String, callback: ResultCallback<UserProfile>)用户资料
updateMyUserProfilefun updateMyUserProfile(profile: UserProfileUpdate, callback: ResultCallback<UserProfile>)用户资料
getOnlineStatusfun getOnlineStatus(userId: String, callback: ResultCallback<UserOnlineStatus>)在线状态
getOnlineStatusBatchfun getOnlineStatusBatch(userIds: List<String>, callback: ResultCallback<UserOnlineStatusBatch>)在线状态
searchUsersfun searchUsers(keyword: String, options: PageOptions? = null, callback: ResultCallback<UserSearchResult>)好友列表
sendFriendRequestfun sendFriendRequest(toUserId: String, message: String? = null, callback: ResultCallback<FriendRequest>)好友请求
getFriendRequestsfun getFriendRequests(options: FriendRequestQuery? = null, callback: ResultCallback<List<FriendRequest>>)好友请求
acceptFriendRequestfun acceptFriendRequest(requestId: String, callback: ResultCallback<FriendRequest>)好友请求
rejectFriendRequestfun rejectFriendRequest(requestId: String, callback: ResultCallback<FriendRequest>)好友请求
getFriendsfun getFriends(callback: ResultCallback<List<Friend>>)好友列表
deleteFriendfun deleteFriend(friendId: String, callback: OperationCallback? = null)好友列表
setFriendRemarkfun setFriendRemark(friendId: String, remark: String, callback: OperationCallback? = null)好友列表
getBlacklistfun getBlacklist(callback: ResultCallback<List<BlacklistUser>>)黑名单
addToBlacklistfun addToBlacklist(userId: String, callback: OperationCallback? = null)黑名单
removeFromBlacklistfun removeFromBlacklist(userId: String, callback: OperationCallback? = null)黑名单
createGroupfun createGroup(options: CreateGroupOptions, callback: ResultCallback<Group>) / fun createGroup(name: String, memberIds: List<String>, options: GroupOptions? = null, callback: ResultCallback<Group>)创建群组
getGroupsInfofun getGroupsInfo(groupIds: List<String>, callback: ResultCallback<List<Group>>)创建群组
getGroupMembersfun getGroupMembers(groupId: String, callback: ResultCallback<List<GroupMember>>)群成员
addGroupMembersfun addGroupMembers(groupId: String, userIds: List<String>, callback: ResultCallback<AddGroupMembersResult>)群成员
removeGroupMembersfun removeGroupMembers(groupId: String, userIds: List<String>, callback: ResultCallback<RemoveGroupMembersResult>)群成员
quitGroupfun quitGroup(groupId: String, callback: OperationCallback? = null)群成员
updateGroupNamefun updateGroupName(groupId: String, name: String, callback: ResultCallback<Group>)群管理
updateGroupNoticefun updateGroupNotice(groupId: String, notice: String, callback: ResultCallback<Group>)群管理
transferGroupOwnerfun transferGroupOwner(groupId: String, newOwner: String, callback: ResultCallback<Group>)群管理
addGroupAdminfun addGroupAdmin(groupId: String, userId: String, callback: ResultCallback<Group>)群管理
removeGroupAdminfun removeGroupAdmin(groupId: String, userId: String, callback: ResultCallback<Group>)群管理
muteGroupMemberfun muteGroupMember(groupId: String, userId: String, mutedUntil: Long, callback: ResultCallback<MuteGroupMemberResult>)群管理
createChatroomfun createChatroom(options: CreateChatroomOptions, callback: ResultCallback<Chatroom>)加入与退出
joinChatroomfun joinChatroom(chatroomId: String, callback: ResultCallback<Chatroom>)加入与退出
leaveChatroomfun leaveChatroom(chatroomId: String, callback: OperationCallback? = null)加入与退出
getChatroomInfofun getChatroomInfo(chatroomId: String, callback: ResultCallback<Chatroom>)聊天室信息
getChatroomMembersfun getChatroomMembers(chatroomId: String, options: PageOptions? = null, callback: ResultCallback<ChatroomMembersPage>)聊天室信息
getSystemMessagesfun getSystemMessages(options: HistoryOptions? = null, callback: ResultCallback<HistoryPage>)系统通知
uploadFilefun uploadFile(data: ByteArray, name: String, mime: String? = null, callback: ResultCallback<UploadResult>)文件上传
updateMessageExpansionfun updateMessageExpansion(messageId: String, expansion: Map<String, String>, callback: OperationCallback?)消息进阶
removeMessageExpansionfun removeMessageExpansion(messageId: String, keys: List<String>, callback: OperationCallback?)消息进阶
addMessageReactionfun addMessageReaction(conversationType: Int, targetId: String, messageId: String, reactionId: String, callback: ResultCallback<MessageReaction>?)消息进阶
removeMessageReactionfun removeMessageReaction(conversationType: Int, targetId: String, messageId: String, reactionId: String, callback: OperationCallback?)消息进阶
batchGetMessageReactionSummariesfun batchGetMessageReactionSummaries(conversationType: Int, targetId: String, messageIds: List<String>, callback: ResultCallback<Map<String, List<MessageReactionSummary>>>?)消息进阶
getMessageReactionsfun getMessageReactions(conversationType: Int, targetId: String, messageId: String, count: Int, pageToken: String?, callback: ResultCallback<MessageReactionPage>?)消息进阶
getMessageReactionUsersfun getMessageReactionUsers(conversationType: Int, targetId: String, messageId: String, reactionId: String, count: Int, pageToken: String?, callback: ResultCallback<MessageReactionUserPage>?)消息进阶
createConversationTagfun createConversationTag(tagName: String, options: CreateConversationTagOptions?, callback: ResultCallback<ConversationTag>?)会话标签与分组
updateConversationTagfun updateConversationTag(tagId: String, tagName: String, callback: ResultCallback<ConversationTag>?)会话标签与分组
deleteConversationTagfun deleteConversationTag(tagId: String, callback: ResultCallback<Unit>?)会话标签与分组
getConversationTagsfun getConversationTags(callback: ResultCallback<List<ConversationTag>>?)会话标签与分组
addConversationsToTagfun addConversationsToTag(tagId: String, conversations: List<ConversationRef>, callback: ResultCallback<ConversationTagMembershipResult>?)会话标签与分组
removeConversationsFromTagfun removeConversationsFromTag(tagId: String, conversations: List<ConversationRef>, callback: ResultCallback<ConversationTagMembershipResult>?)会话标签与分组
getConversationsFromTagByPagefun getConversationsFromTagByPage(tagId: String, options: ConversationTagPageOptions?, callback: ResultCallback<ConversationTagPage>?)会话标签与分组
getTagsFromConversationfun getTagsFromConversation(conversationType: Int, targetId: String, callback: ResultCallback<List<ConversationTag>>?)会话标签与分组
getUnreadCountByTagfun getUnreadCountByTag(tagId: String, callback: ResultCallback<ConversationTagUnread>?)会话标签与分组
setConversationToTopInTagfun setConversationToTopInTag(tagId: String, conversationType: Int, targetId: String, top: Boolean, callback: ResultCallback<Unit>?)会话标签与分组
deleteConversationfun deleteConversation(conversationType: Int, targetId: String, callback: ResultCallback<Boolean>?)会话删除与类型免打扰
getConversationTypeNotificationfun getConversationTypeNotification(conversationType: Int, callback: ResultCallback<ConversationTypeNotification>?)会话删除与类型免打扰
setConversationTypeNotificationfun setConversationTypeNotification(conversationType: Int, level: Int, callback: ResultCallback<ConversationTypeNotification>?)会话删除与类型免打扰
startStreamMessagefun startStreamMessage(conversationType: Int, targetId: String, options: StartStreamMessageOptions? = null, callback: ResultCallback<StreamMessage>? = null)消息进阶
appendStreamMessagefun appendStreamMessage(streamId: String, delta: String, options: AppendStreamMessageOptions? = null, callback: ResultCallback<StreamMessage>? = null)消息进阶
completeStreamMessagefun completeStreamMessage(streamId: String, callback: ResultCallback<StreamCompleteResult>? = null)消息进阶
getStreamMessagefun getStreamMessage(streamId: String, callback: ResultCallback<StreamMessage>? = null)消息进阶
getMessageExpansionfun getMessageExpansion(messageId: String, callback: ResultCallback<MessageExpansion>?)消息进阶
combineMessagesfun combineMessages(messages: List<Message>, options: CombineMessagesOptions?, callback: ResultCallback<CombineContent>?)消息进阶
subscribePresencefun subscribePresence(userIds: List<String>, callback: ResultCallback<PresenceSubscription>?)在线状态订阅与推送令牌
unsubscribePresencefun unsubscribePresence(userIds: List<String>, callback: ResultCallback<PresenceSubscription>?)在线状态订阅与推送令牌
getPresenceSubscriptionsfun getPresenceSubscriptions(callback: ResultCallback<PresenceSubscription>?)在线状态订阅与推送令牌
registerPushTokenfun registerPushToken(options: RegisterPushTokenOptions, callback: ResultCallback<PushToken>?)在线状态订阅与推送令牌
unregisterPushTokenfun unregisterPushToken(tokenId: String, callback: ResultCallback<UnregisterPushTokenResult>?)在线状态订阅与推送令牌
getPushTokensfun getPushTokens(callback: ResultCallback<PushTokenListResult>?)在线状态订阅与推送令牌
createSupergroupChannelfun createSupergroupChannel(params: CreateSupergroupChannelParams, callback: ResultCallback<SupergroupChannel>?)超级群频道与用户组
listSupergroupChannelsfun listSupergroupChannels(groupId: String, callback: ResultCallback<SupergroupChannelListResult>?)超级群频道与用户组
joinSupergroupChannelfun joinSupergroupChannel(channelId: String, options: SupergroupChannelOptions? = null, callback: ResultCallback<JoinSupergroupChannelResult>?)超级群频道与用户组
leaveSupergroupChannelfun leaveSupergroupChannel(channelId: String, options: SupergroupChannelOptions? = null, callback: ResultCallback<LeaveSupergroupChannelResult>?)超级群频道与用户组
bindUserGroupToChannelfun bindUserGroupToChannel(channelId: String, userGroupId: String, options: SupergroupChannelOptions? = null, callback: ResultCallback<BindUserGroupToChannelResult>?)超级群频道与用户组
createUserGroupfun createUserGroup(params: CreateUserGroupParams, callback: ResultCallback<UserGroup>?)超级群频道与用户组
listUserGroupsfun listUserGroups(groupId: String, callback: ResultCallback<UserGroupListResult>?)超级群频道与用户组
getUserGroupsByUserfun getUserGroupsByUser(userId: String, options: SupergroupChannelOptions? = null, callback: ResultCallback<UserGroupListResult>?)超级群频道与用户组
getStreamingMessages绑定便捷方法进行中的流式消息占位列表(本地状态;增量渲染建议订阅 STREAM_MESSAGE_CHANGED 事件)。
isUserOnline绑定便捷方法订阅关系内的本地在线状态快照(不发起请求);权威值用 getOnlineStatus / getOnlineStatusBatch。
getSubscribedPresence绑定便捷方法本地订阅列表只读快照(getPresenceSubscriptions 请求失败时兜底展示)。
dispose绑定便捷方法释放客户端:断连、停止重连与心跳、关闭本地库资源、清空监听器;释放后同一 appkey 再 init 会创建新实例。

事件索引​

事件名在所有 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_RECEIPTReadReceipt是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 参考的「枚举」页逐项列出(名称、取值、语义),错误码另有状态码页。

常量 / 枚举取值数文档位置
IMClientEvent16枚举 · event-type
ConnectionStatus4枚举 · connection-status
ConversationType5枚举 · conversation-type
Direction2枚举 · direction
NotificationLevel3枚举 · notification-level
ContentType10枚举 · content-type
GroupType2枚举 · group-type
GroupRole3枚举 · group-role
MentionType2枚举 · mention-type
FriendRequestStatus3枚举 · friend-request-status
FriendEventKind3枚举 · friend-event-kind
ChatroomEventKind5枚举 · chatroom-event-kind
SendStatus3状态码与错误处理
ErrorCode39枚举 · error-code
SYSTEM_TARGET_ID—状态码与错误处理
CONTENT_TYPE_COMBINE—状态码与错误处理

数据类型索引​

公开数据类型分两类:有独立页面的核心结构(消息、会话、群组、内容联合体等),以及只作为参数/返回结构出现的选项与结果对象(字段在对应方法的参数表与返回值中说明)。

随方法说明的类型​

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

平台导出的类型与包符号​

制品公开面还导出 63 个平台类型/包符号(选项对象、回调、传输层与结果结构);IDL 语义面之外的符号在对应方法的参数表与返回值中说明,或由包内的类型声明提供。

IMClientOptions、SendOptions、TextSendOptions、RecallOptions、PageOptions、HistoryOptions、SearchMessagesOptions、FriendRequestQuery、CreateGroupOptions、GroupOptions、PresenceSubscription、CreateChatroomOptions、UserProfileUpdate、UserOnlineStatus、UserOnlineStatusBatch、BlacklistUser、UserSearchItem、UserSearchResult、ReadReceipt、ConnectResult、HistoryPage、MessageSearchResult、ReadReceiptResult、MessageReadCount、MessageReadUsers、AddGroupMembersResult、RemoveGroupMembersResult、MuteGroupMemberResult、ChatroomMembersPage、UploadResult、MessageReactionUser、MessageReactionSummary、MessageReaction、MessageReactionPage、MessageReactionUserPage、MessageExpansion、MessageExpansionRemoval、ConversationTagPage、ConversationTagMembershipResult、ConversationTagUnread、ConversationTypeNotification、ConversationTagPageOptions、CreateConversationTagOptions、StreamSegment、StreamCompleteResult、StartStreamMessageOptions、AppendStreamMessageOptions、CombineItem、CombineMessagesOptions、PushPlatform、PushTokenListResult、UnregisterPushTokenResult、RegisterPushTokenOptions、SupergroupChannelListResult、CreateSupergroupChannelParams、SupergroupChannelOptions、UserGroupListResult、CreateUserGroupParams、JoinSupergroupChannelResult、LeaveSupergroupChannelResult、BindUserGroupToChannelResult、RcResult、IMError

如何反馈差异​

  • 方法语义与签名:以 功能列表 与各功能页为准;
  • 错误码与重试:见 状态码;
  • 若发现“制品导出但文档未说明”或“文档说明但制品未导出”,请提交到文档反馈渠道,会按版本更新日志同步。