Objective-C API 索引

本页按 IDL 语义操作顺序列出 Objective-C 声明,并与 Swift 签名逐项对照。共 103 个操作;声明来源:SDK 产物(objc-surface)。

为什么不会漂移

ObjC 声明优先来自 SDK 产出的 ObjC 表面文件,其次按 IDL 参数与选择器命名规则生成;两条路径都以同一份 sdk-imlib.json 为事实源。

页面生成时与 Swift 的 methodMap 同表输出;任何一侧缺失都会在生成阶段暴露,而不是留到运行时。

选择器命名规则​

  • 第一个参数并入方法名:`sendTextMessage` + `conversationType` → `sendTextMessageWithConversationType:`。
  • 后续参数按参数名作为标签:`targetId:`、`text:`、`options:`。
  • 有返回数据的操作追加 `completion:(void (^)(IMPOSResult *result))completion`;本地同步操作(连接状态 / 当前用户)直接返回。
  • 事件注册:`addEventListener:listener:` / `removeEventListener:listener:`。

全量索引​

语义操作Objective-C 声明Swift 签名
init+ (instancetype)initWithAppkey:(NSString *)appkey serverUrl:(NSString * _Nullable)serverUrl(另:+ (instancetype)sharedWithAppkey:serverUrl: 应用内单例)static func client(options: IMPClientOptions) -> IMPClient
connect- (void)connectWithToken:(NSString *)token completion:(void (^)(IMPOSResult *result))completionfunc connect(token: String) async -> RcResult<IMPConnectResult>
disconnect- (void)disconnectWithCompletion:(void (^)(IMPOSResult *result))completionfunc disconnect() async -> RcResult<Void>
getConnectionStatus- (NSInteger)getConnectionStatusfunc getConnectionStatus() -> IMPConnectionStatus
getCurrentUserId- (NSString *)getCurrentUserIdfunc getCurrentUserId() -> String
addEventListener- (IMPOSListenerToken *)addEventListener:(NSString *)eventName handler:(void (^)(IMPOSEvent *event))handlerfunc addEventListener(_ event: IMPEvent, listener: IMPEventListener) -> Void
removeEventListener- (void)removeEventListener:(IMPOSListenerToken *)tokenfunc removeEventListener(_ event: IMPEvent, listener: IMPEventListener) -> Void
sendMessage- (void)sendMessageWithConversationType:(NSInteger)conversationType targetId:(NSString *)targetId content:(NSDictionary<NSString *, id> *)content options:(NSDictionary<NSString *, id> * _Nullable)options completion:(void (^)(IMPOSResult *result))completionfunc sendMessage(conversationType: IMPConversationType, targetId: String, content: IMPMessageContent, options: IMPSendOptions?) async -> RcResult<IMPMessage>
sendTextMessage- (void)sendTextMessageWithConversationType:(NSInteger)conversationType targetId:(NSString *)targetId text:(NSString *)text options:(NSDictionary<NSString *, id> * _Nullable)options completion:(void (^)(IMPOSResult *result))completionfunc sendTextMessage(conversationType: IMPConversationType, targetId: String, text: String, options: IMPTextSendOptions?) async -> RcResult<IMPMessage>
sendImageMessage- (void)sendImageMessageWithConversationType:(NSInteger)conversationType targetId:(NSString *)targetId content:(NSDictionary<NSString *, id> *)content options:(NSDictionary<NSString *, id> * _Nullable)options completion:(void (^)(IMPOSResult *result))completionfunc sendImageMessage(conversationType: IMPConversationType, targetId: String, content: IMPImageContent, options: IMPSendOptions?) async -> RcResult<IMPMessage>
sendFileMessage- (void)sendFileMessageWithConversationType:(NSInteger)conversationType targetId:(NSString *)targetId content:(NSDictionary<NSString *, id> *)content options:(NSDictionary<NSString *, id> * _Nullable)options completion:(void (^)(IMPOSResult *result))completionfunc sendFileMessage(conversationType: IMPConversationType, targetId: String, content: IMPFileContent, options: IMPSendOptions?) async -> RcResult<IMPMessage>
sendVoiceMessage- (void)sendVoiceMessageWithConversationType:(NSInteger)conversationType targetId:(NSString *)targetId content:(NSDictionary<NSString *, id> *)content options:(NSDictionary<NSString *, id> * _Nullable)options completion:(void (^)(IMPOSResult *result))completionfunc sendVoiceMessage(conversationType: IMPConversationType, targetId: String, content: IMPVoiceContent, options: IMPSendOptions?) async -> RcResult<IMPMessage>
sendLocationMessage- (void)sendLocationMessageWithConversationType:(NSInteger)conversationType targetId:(NSString *)targetId content:(NSDictionary<NSString *, id> *)content options:(NSDictionary<NSString *, id> * _Nullable)options completion:(void (^)(IMPOSResult *result))completionfunc sendLocationMessage(conversationType: IMPConversationType, targetId: String, content: IMPLocationContent, options: IMPSendOptions?) async -> RcResult<IMPMessage>
sendTypingStatus- (void)sendTypingStatusWithConversationType:(NSInteger)conversationType targetId:(NSString *)targetId typing:(BOOL)typing completion:(void (^)(IMPOSResult *result))completionfunc sendTypingStatus(conversationType: IMPConversationType, targetId: String, typing: Bool) async -> RcResult<Void>
recallMessage- (void)recallMessageWithMessageId:(NSString *)messageId completion:(void (^)(IMPOSResult *result))completionfunc recallMessage(messageId: String) async -> RcResult<IMPMessage>
sendReadReceipt- (void)sendReadReceiptWithConversationType:(NSInteger)conversationType targetId:(NSString *)targetId messageIds:(NSArray<NSString *> *)messageIds completion:(void (^)(IMPOSResult *result))completionfunc sendReadReceipt(conversationType: IMPConversationType, targetId: String, messageIds: [String]) async -> RcResult<IMPSendReadReceiptResult>
getMessageReadCount- (void)getMessageReadCountWithMessageId:(NSString *)messageId completion:(void (^)(IMPOSResult *result))completionfunc getMessageReadCount(messageId: String) async -> RcResult<IMPMessageReadCount>
getMessageReadUsers- (void)getMessageReadUsersWithMessageId:(NSString *)messageId options:(NSDictionary<NSString *, id> * _Nullable)options completion:(void (^)(IMPOSResult *result))completionfunc getMessageReadUsers(messageId: String, options: IMPPageOptions?) async -> RcResult<IMPMessageReadUsers>
getMessageReadDetail- (void)getMessageReadDetailWithMessageId:(NSString *)messageId options:(NSDictionary<NSString *, id> * _Nullable)options completion:(void (^)(IMPOSResult *result))completionfunc getMessageReadDetail(messageId: String, options: IMPPageOptions?) async -> RcResult<IMPMessageReadDetail>
searchMessages- (void)searchMessagesWithOptions:(NSDictionary<NSString *, id> *)options completion:(void (^)(IMPOSResult *result))completionfunc searchMessages(options: IMPSearchMessagesOptions) async -> RcResult<IMPMessageSearchResult>
getConversationList- (void)getConversationListWithCompletion:(void (^)(IMPOSResult *result))completionfunc getConversationList() async -> RcResult<[IMPConversation]>
getConversation- (void)getConversationWithConversationType:(NSInteger)conversationType targetId:(NSString *)targetId completion:(void (^)(IMPOSResult *result))completionfunc getConversation(conversationType: IMPConversationType, targetId: String) async -> RcResult<IMPConversation>
getHistoryMessages- (void)getHistoryMessagesWithConversationType:(NSInteger)conversationType targetId:(NSString *)targetId options:(NSDictionary<NSString *, id> * _Nullable)options completion:(void (^)(IMPOSResult *result))completionfunc getHistoryMessages(conversationType: IMPConversationType, targetId: String, options: IMPHistoryOptions?) async -> RcResult<IMPHistoryPage>
clearUnreadCount- (void)clearUnreadCountWithConversationType:(NSInteger)conversationType targetId:(NSString *)targetId completion:(void (^)(IMPOSResult *result))completionfunc clearUnreadCount(conversationType: IMPConversationType, targetId: String) async -> RcResult<Void>
setConversationToTop- (void)setConversationToTopWithConversationType:(NSInteger)conversationType targetId:(NSString *)targetId isTop:(BOOL)isTop completion:(void (^)(IMPOSResult *result))completionfunc setConversationToTop(conversationType: IMPConversationType, targetId: String, isTop: Bool) async -> RcResult<Void>
saveTextMessageDraft- (void)saveTextMessageDraftWithConversationType:(NSInteger)conversationType targetId:(NSString *)targetId draft:(NSString *)draft completion:(void (^)(IMPOSResult *result))completionfunc saveTextMessageDraft(conversationType: IMPConversationType, targetId: String, draft: String) async -> RcResult<Void>
getTextMessageDraft- (void)getTextMessageDraftWithConversationType:(NSInteger)conversationType targetId:(NSString *)targetId completion:(void (^)(IMPOSResult *result))completionfunc getTextMessageDraft(conversationType: IMPConversationType, targetId: String) async -> RcResult<String>
clearTextMessageDraft- (void)clearTextMessageDraftWithConversationType:(NSInteger)conversationType targetId:(NSString *)targetId completion:(void (^)(IMPOSResult *result))completionfunc clearTextMessageDraft(conversationType: IMPConversationType, targetId: String) async -> RcResult<Void>
setConversationNotificationLevel- (void)setConversationNotificationLevelWithConversationType:(NSInteger)conversationType targetId:(NSString *)targetId level:(NSInteger)level completion:(void (^)(IMPOSResult *result))completionfunc setConversationNotificationLevel(conversationType: IMPConversationType, targetId: String, level: IMPNotificationLevel) async -> RcResult<Void>
getUserProfile- (void)getUserProfileWithUserId:(NSString *)userId completion:(void (^)(IMPOSResult *result))completionfunc getUserProfile(userId: String) async -> RcResult<IMPUserProfile>
updateMyUserProfile- (void)updateMyUserProfileWithProfile:(NSDictionary<NSString *, id> *)profile completion:(void (^)(IMPOSResult *result))completionfunc updateMyUserProfile(profile: IMPUserProfileUpdate) async -> RcResult<IMPUserProfile>
getOnlineStatus- (void)getOnlineStatusWithUserId:(NSString *)userId completion:(void (^)(IMPOSResult *result))completionfunc getOnlineStatus(userId: String) async -> RcResult<IMPUserOnlineStatus>
getOnlineStatusBatch- (void)getOnlineStatusBatchWithUserIds:(NSArray<NSString *> *)userIds completion:(void (^)(IMPOSResult *result))completionfunc getOnlineStatusBatch(userIds: [String]) async -> RcResult<IMPUserOnlineStatusBatch>
searchUsers- (void)searchUsersWithKeyword:(NSString *)keyword options:(NSDictionary<NSString *, id> * _Nullable)options completion:(void (^)(IMPOSResult *result))completionfunc searchUsers(keyword: String, options: IMPPageOptions?) async -> RcResult<IMPUserSearchResult>
sendFriendRequest- (void)sendFriendRequestWithToUserId:(NSString *)toUserId message:(NSString * _Nullable)message completion:(void (^)(IMPOSResult *result))completionfunc sendFriendRequest(toUserId: String, message: String?) async -> RcResult<IMPFriendRequest>
getFriendRequests- (void)getFriendRequestsWithOptions:(NSDictionary<NSString *, id> * _Nullable)options completion:(void (^)(IMPOSResult *result))completionfunc getFriendRequests(options: IMPFriendRequestQuery?) async -> RcResult<[IMPFriendRequest]>
acceptFriendRequest- (void)acceptFriendRequestWithRequestId:(NSString *)requestId completion:(void (^)(IMPOSResult *result))completionfunc acceptFriendRequest(requestId: String) async -> RcResult<IMPFriendRequest>
rejectFriendRequest- (void)rejectFriendRequestWithRequestId:(NSString *)requestId completion:(void (^)(IMPOSResult *result))completionfunc rejectFriendRequest(requestId: String) async -> RcResult<IMPFriendRequest>
getFriends- (void)getFriendsWithCompletion:(void (^)(IMPOSResult *result))completionfunc getFriends() async -> RcResult<[IMPFriend]>
deleteFriend- (void)deleteFriendWithFriendId:(NSString *)friendId completion:(void (^)(IMPOSResult *result))completionfunc deleteFriend(friendId: String) async -> RcResult<Void>
setFriendRemark- (void)setFriendRemarkWithFriendId:(NSString *)friendId remark:(NSString *)remark completion:(void (^)(IMPOSResult *result))completionfunc setFriendRemark(friendId: String, remark: String) async -> RcResult<Void>
getBlacklist- (void)getBlacklistWithCompletion:(void (^)(IMPOSResult *result))completionfunc getBlacklist() async -> RcResult<[IMPBlacklistEntry]>
addToBlacklist- (void)addToBlacklistWithUserId:(NSString *)userId completion:(void (^)(IMPOSResult *result))completionfunc addToBlacklist(userId: String) async -> RcResult<Void>
removeFromBlacklist- (void)removeFromBlacklistWithUserId:(NSString *)userId completion:(void (^)(IMPOSResult *result))completionfunc removeFromBlacklist(userId: String) async -> RcResult<Void>
createGroup- (void)createGroupWithOptions:(NSDictionary<NSString *, id> *)options completion:(void (^)(IMPOSResult *result))completionfunc createGroup(_ options: IMPCreateGroupOptions) async -> RcResult<IMPGroup>
getGroupsInfo- (void)getGroupsInfoWithGroupIds:(NSArray<NSString *> *)groupIds completion:(void (^)(IMPOSResult *result))completionfunc getGroupsInfo(groupIds: [String]) async -> RcResult<[IMPGroup]>
getGroupMembers- (void)getGroupMembersWithGroupId:(NSString *)groupId completion:(void (^)(IMPOSResult *result))completionfunc getGroupMembers(groupId: String) async -> RcResult<[IMPGroupMember]>
addGroupMembers- (void)addGroupMembersWithGroupId:(NSString *)groupId userIds:(NSArray<NSString *> *)userIds completion:(void (^)(IMPOSResult *result))completionfunc addGroupMembers(groupId: String, userIds: [String]) async -> RcResult<IMPAddGroupMembersResult>
removeGroupMembers- (void)removeGroupMembersWithGroupId:(NSString *)groupId userIds:(NSArray<NSString *> *)userIds completion:(void (^)(IMPOSResult *result))completionfunc removeGroupMembers(groupId: String, userIds: [String]) async -> RcResult<IMPRemoveGroupMembersResult>
quitGroup- (void)quitGroupWithGroupId:(NSString *)groupId completion:(void (^)(IMPOSResult *result))completionfunc quitGroup(groupId: String) async -> RcResult<Void>
updateGroupName- (void)updateGroupNameWithGroupId:(NSString *)groupId name:(NSString *)name completion:(void (^)(IMPOSResult *result))completionfunc updateGroupName(groupId: String, name: String) async -> RcResult<IMPGroup>
updateGroupNotice- (void)updateGroupNoticeWithGroupId:(NSString *)groupId notice:(NSString *)notice completion:(void (^)(IMPOSResult *result))completionfunc updateGroupNotice(groupId: String, notice: String) async -> RcResult<IMPGroup>
transferGroupOwner- (void)transferGroupOwnerWithGroupId:(NSString *)groupId newOwner:(NSString *)newOwner completion:(void (^)(IMPOSResult *result))completionfunc transferGroupOwner(groupId: String, newOwner: String) async -> RcResult<IMPGroup>
addGroupAdmin- (void)addGroupAdminWithGroupId:(NSString *)groupId userId:(NSString *)userId completion:(void (^)(IMPOSResult *result))completionfunc addGroupAdmin(groupId: String, userId: String) async -> RcResult<IMPGroup>
removeGroupAdmin- (void)removeGroupAdminWithGroupId:(NSString *)groupId userId:(NSString *)userId completion:(void (^)(IMPOSResult *result))completionfunc removeGroupAdmin(groupId: String, userId: String) async -> RcResult<IMPGroup>
muteGroupMember- (void)muteGroupMemberWithGroupId:(NSString *)groupId userId:(NSString *)userId mutedUntil:(unsigned long long)mutedUntil completion:(void (^)(IMPOSResult *result))completionfunc muteGroupMember(groupId: String, userId: String, mutedUntil: UInt64) async -> RcResult<IMPMuteGroupMemberResult>
createChatroom- (void)createChatroomWithOptions:(NSDictionary<NSString *, id> *)options completion:(void (^)(IMPOSResult *result))completionfunc createChatroom(options: IMPCreateChatroomOptions) async -> RcResult<IMPChatroom>
joinChatroom- (void)joinChatroomWithChatroomId:(NSString *)chatroomId completion:(void (^)(IMPOSResult *result))completionfunc joinChatroom(chatroomId: String) async -> RcResult<IMPChatroom>
leaveChatroom- (void)leaveChatroomWithChatroomId:(NSString *)chatroomId completion:(void (^)(IMPOSResult *result))completionfunc leaveChatroom(chatroomId: String) async -> RcResult<Void>
getChatroomInfo- (void)getChatroomInfoWithChatroomId:(NSString *)chatroomId completion:(void (^)(IMPOSResult *result))completionfunc getChatroomInfo(chatroomId: String) async -> RcResult<IMPChatroom>
getChatroomMembers- (void)getChatroomMembersWithChatroomId:(NSString *)chatroomId options:(NSDictionary<NSString *, id> * _Nullable)options completion:(void (^)(IMPOSResult *result))completionfunc getChatroomMembers(chatroomId: String, options: IMPPageOptions?) async -> RcResult<IMPChatroomMembersPage>
getSystemMessages- (void)getSystemMessagesWithOptions:(NSDictionary<NSString *, id> * _Nullable)options completion:(void (^)(IMPOSResult *result))completionfunc getSystemMessages(options: IMPHistoryOptions?) async -> RcResult<IMPHistoryPage>
uploadFile- (void)uploadFileWithData:(NSData *)data name:(NSString *)name mime:(NSString * _Nullable)mime completion:(void (^)(IMPOSResult *result))completionfunc uploadFile(data: Data, name: String, mime: String?) async -> RcResult<IMPUploadResult>
updateMessageExpansion- (void)updateMessageExpansionWithMessageId:(NSString *)messageId expansion:(NSDictionary<NSString *, NSString *> *)expansion completion:(void (^)(IMPOSResult *result))completionfunc updateMessageExpansion(messageId: String, expansion: [String: String]) async -> RcResult<IMPExpansion>
removeMessageExpansion- (void)removeMessageExpansionWithMessageId:(NSString *)messageId keys:(NSArray<NSString *> *)keys completion:(void (^)(IMPOSResult *result))completionfunc removeMessageExpansion(messageId: String, keys: [String]) async -> RcResult<IMPExpansion>
addMessageReaction- (void)addMessageReactionWithParam:(NSDictionary<NSString *, id> *)param completion:(void (^)(IMPOSResult *result))completionfunc addMessageReaction(_ param: IMPUpdateMessageReactionParam) async -> RcResult<IMPMessageReaction>
removeMessageReaction- (void)removeMessageReactionWithParam:(NSDictionary<NSString *, id> *)param completion:(void (^)(IMPOSResult *result))completionfunc removeMessageReaction(_ param: IMPUpdateMessageReactionParam) async -> RcResult<IMPReactionRemoval>
batchGetMessageReactionSummaries- (void)batchGetMessageReactionSummariesWithParam:(NSDictionary<NSString *, id> *)param completion:(void (^)(IMPOSResult *result))completionfunc batchGetMessageReactionSummaries(_ param: IMPMessageReactionSummaryQuery) async -> RcResult<[String: [IMPMessageReactionSummary]]>
getMessageReactions- (void)getMessageReactionsWithParam:(NSDictionary<NSString *, id> *)param completion:(void (^)(IMPOSResult *result))completionfunc getMessageReactions(_ param: IMPGetMessageReactionsParam) async -> RcResult<IMPMessageReactionPage>
getMessageReactionUsers- (void)getMessageReactionUsersWithParam:(NSDictionary<NSString *, id> *)param completion:(void (^)(IMPOSResult *result))completionfunc getMessageReactionUsers(_ param: IMPGetMessageReactionUsersParam) async -> RcResult<IMPMessageReactionUserPage>
createConversationTag- (void)createConversationTagWithParam:(NSDictionary<NSString *, id> *)param completion:(void (^)(IMPOSResult *result))completionfunc createConversationTag(_ param: IMPCreateConversationTagParam) async -> RcResult<IMPConversationTag>
updateConversationTag- (void)updateConversationTagWithParam:(NSDictionary<NSString *, id> *)param completion:(void (^)(IMPOSResult *result))completionfunc updateConversationTag(_ param: IMPUpdateConversationTagParam) async -> RcResult<IMPConversationTag>
deleteConversationTag- (void)deleteConversationTagWithTagId:(NSString *)tagId completion:(void (^)(IMPOSResult *result))completionfunc deleteConversationTag(tagId: String) async -> RcResult<Void>
getConversationTags- (void)getConversationTagsWithCompletion:(void (^)(IMPOSResult *result))completionfunc getConversationTags() async -> RcResult<[IMPConversationTag]>
addConversationsToTag- (void)addConversationsToTagWithParam:(NSDictionary<NSString *, id> *)param completion:(void (^)(IMPOSResult *result))completionfunc addConversationsToTag(_ param: IMPTagConversationsParam) async -> RcResult<IMPConversationTagMembershipResult>
removeConversationsFromTag- (void)removeConversationsFromTagWithParam:(NSDictionary<NSString *, id> *)param completion:(void (^)(IMPOSResult *result))completionfunc removeConversationsFromTag(_ param: IMPTagConversationsParam) async -> RcResult<IMPConversationTagMembershipResult>
getConversationsFromTagByPage- (void)getConversationsFromTagByPageWithParam:(NSDictionary<NSString *, id> *)param completion:(void (^)(IMPOSResult *result))completionfunc getConversationsFromTagByPage(_ param: IMPTagConversationsPageParam) async -> RcResult<IMPConversationTagPage>
getTagsFromConversation- (void)getTagsFromConversationWithConversationType:(NSInteger)conversationType targetId:(NSString *)targetId completion:(void (^)(IMPOSResult *result))completionfunc getTagsFromConversation(conversationType: Int, targetId: String) async -> RcResult<[IMPConversationTag]>
getUnreadCountByTag- (void)getUnreadCountByTagWithTagId:(NSString *)tagId completion:(void (^)(IMPOSResult *result))completionfunc getUnreadCountByTag(tagId: String) async -> RcResult<IMPConversationTagUnread>
setConversationToTopInTag- (void)setConversationToTopInTagWithParam:(NSDictionary<NSString *, id> *)param completion:(void (^)(IMPOSResult *result))completionfunc setConversationToTopInTag(_ param: IMPTagTopParam) async -> RcResult<Void>
deleteConversation- (void)deleteConversationWithConversationType:(NSInteger)conversationType targetId:(NSString *)targetId completion:(void (^)(IMPOSResult *result))completionfunc deleteConversation(conversationType: Int, targetId: String) async -> RcResult<Bool>
getConversationTypeNotification- (void)getConversationTypeNotificationWithConversationType:(NSInteger)conversationType completion:(void (^)(IMPOSResult *result))completionfunc getConversationTypeNotification(conversationType: Int) async -> RcResult<IMPConversationTypeNotification>
setConversationTypeNotification- (void)setConversationTypeNotificationWithConversationType:(NSInteger)conversationType level:(NSInteger)level completion:(void (^)(IMPOSResult *result))completionfunc setConversationTypeNotification(conversationType: Int, level: Int) async -> RcResult<IMPConversationTypeNotification>
startStreamMessage- (void)startStreamMessageWithParam:(NSDictionary<NSString *, id> *)param completion:(void (^)(IMPOSResult *result))completionfunc startStreamMessage(_ param: IMPStartStreamMessageParam) async -> RcResult<IMPStreamMessage>
appendStreamMessage- (void)appendStreamMessageWithStreamId:(NSString *)streamId delta:(NSString *)delta seq:(NSNumber * _Nullable)seq completion:(void (^)(IMPOSResult *result))completionfunc appendStreamMessage(streamId: String, delta: String, seq: UInt32?) async -> RcResult<IMPStreamMessage>
completeStreamMessage- (void)completeStreamMessageWithStreamId:(NSString *)streamId completion:(void (^)(IMPOSResult *result))completionfunc completeStreamMessage(streamId: String) async -> RcResult<IMPStreamCompleteResult>
getStreamMessage- (void)getStreamMessageWithStreamId:(NSString *)streamId completion:(void (^)(IMPOSResult *result))completionfunc getStreamMessage(streamId: String) async -> RcResult<IMPStreamMessage>
getMessageExpansion- (void)getMessageExpansionWithMessageId:(NSString *)messageId completion:(void (^)(IMPOSResult *result))completionfunc getMessageExpansion(messageId: String) async -> RcResult<IMPMessageExpansion>
combineMessages- (IMPOSResult *)combineMessages:(NSArray<NSDictionary<NSString *, id> *> *)messages options:(NSDictionary<NSString *, id> * _Nullable)optionsfunc combineMessages(_ messages: [IMPMessage], options: IMPCombineMessagesOptions?) -> RcResult<IMPCombineContent>
subscribePresence- (void)subscribePresenceWithUserIds:(NSArray<NSString *> *)userIds completion:(void (^)(IMPOSResult *result))completionfunc subscribePresence(userIds: [String]) async -> RcResult<IMPPresenceSubscription>
unsubscribePresence- (void)unsubscribePresenceWithUserIds:(NSArray<NSString *> *)userIds completion:(void (^)(IMPOSResult *result))completionfunc unsubscribePresence(userIds: [String]) async -> RcResult<IMPPresenceSubscription>
getPresenceSubscriptions- (void)getPresenceSubscriptionsWithCompletion:(void (^)(IMPOSResult *result))completionfunc getPresenceSubscriptions() async -> RcResult<IMPPresenceSubscription>
registerPushToken- (void)registerPushTokenWithOptions:(NSDictionary<NSString *, id> *)options completion:(void (^)(IMPOSResult *result))completionfunc registerPushToken(options: IMPRegisterPushTokenOptions) async -> RcResult<IMPPushToken>
unregisterPushToken- (void)unregisterPushTokenWithTokenId:(NSString *)tokenId completion:(void (^)(IMPOSResult *result))completionfunc unregisterPushToken(tokenId: String) async -> RcResult<IMPUnregisterPushTokenResult>
getPushTokens- (void)getPushTokensWithCompletion:(void (^)(IMPOSResult *result))completionfunc getPushTokens() async -> RcResult<IMPPushTokenListResult>
createSupergroupChannel- (void)createSupergroupChannelWithParams:(NSDictionary<NSString *, id> *)params completion:(void (^)(IMPOSResult *result))completionfunc createSupergroupChannel(params: IMPCreateSupergroupChannelParams) async -> RcResult<IMPSupergroupChannel>
listSupergroupChannels- (void)listSupergroupChannelsWithGroupId:(NSString *)groupId completion:(void (^)(IMPOSResult *result))completionfunc listSupergroupChannels(groupId: String) async -> RcResult<IMPSupergroupChannelListResult>
joinSupergroupChannel- (void)joinSupergroupChannelWithChannelId:(NSString *)channelId options:(NSDictionary<NSString *, id> * _Nullable)options completion:(void (^)(IMPOSResult *result))completionfunc joinSupergroupChannel(channelId: String, options: IMPSupergroupChannelOptions?) async -> RcResult<IMPJoinSupergroupChannelResult>
leaveSupergroupChannel- (void)leaveSupergroupChannelWithChannelId:(NSString *)channelId options:(NSDictionary<NSString *, id> * _Nullable)options completion:(void (^)(IMPOSResult *result))completionfunc leaveSupergroupChannel(channelId: String, options: IMPSupergroupChannelOptions?) async -> RcResult<IMPLeaveSupergroupChannelResult>
bindUserGroupToChannel- (void)bindUserGroupToChannelWithChannelId:(NSString *)channelId userGroupId:(NSString *)userGroupId options:(NSDictionary<NSString *, id> * _Nullable)options completion:(void (^)(IMPOSResult *result))completionfunc bindUserGroupToChannel(channelId: String, userGroupId: String, options: IMPSupergroupChannelOptions?) async -> RcResult<IMPBindUserGroupToChannelResult>
createUserGroup- (void)createUserGroupWithParams:(NSDictionary<NSString *, id> *)params completion:(void (^)(IMPOSResult *result))completionfunc createUserGroup(params: IMPCreateUserGroupParams) async -> RcResult<IMPUserGroup>
listUserGroups- (void)listUserGroupsWithGroupId:(NSString *)groupId completion:(void (^)(IMPOSResult *result))completionfunc listUserGroups(groupId: String) async -> RcResult<IMPUserGroupListResult>
getUserGroupsByUser- (void)getUserGroupsByUserWithUserId:(NSString *)userId options:(NSDictionary<NSString *, id> * _Nullable)options completion:(void (^)(IMPOSResult *result))completionfunc getUserGroupsByUser(userId: String, options: IMPSupergroupChannelOptions?) async -> RcResult<IMPUserGroupListResult>

与 SDK ObjC 表面的交叉校验​

项数量 / 值说明
IDL 语义操作103sdk-imlib.json 的操作全集
ObjC 表面声明103 / 103SDK 产出的 ObjC 表面 methodMap 覆盖数
工厂 / 事件 API3init / addEventListener / removeEventListener 的专门形态(工厂、eventApi)
按 IDL 规则补充0无需补充
表面声明校验0 处待修正全部声明可解析
声明来源SDK 产物(objc-surface)页面生成时读取,不手写

上述交叉校验在每次生成时执行:表面缺失的操作会回退到 IDL 命名规则,并在上表列出;表面存在时以表面声明为准。

IMKit 组件 ObjC 表面​

组件ObjC 声明 / 符号
ConversationListViewIMPOSClient · init
ChatViewIMPOSClient · initWithConversationType
MessageBubble未导出独立类(Swift 专用 helper;ObjC 通过 IMPOSChatViewController / IMPOSConversationListViewController 定制)
MessageInput未导出独立类(Swift 专用 helper;ObjC 通过 IMPOSChatViewController / IMPOSConversationListViewController 定制)
Avatar未导出独立类(Swift 专用 helper;ObjC 通过 IMPOSChatViewController / IMPOSConversationListViewController 定制)
UnreadBadge未导出独立类(Swift 专用 helper;ObjC 通过 IMPOSChatViewController / IMPOSConversationListViewController 定制)
TimeSeparator未导出独立类(Swift 专用 helper;ObjC 通过 IMPOSChatViewController / IMPOSConversationListViewController 定制)
MessageStatusIndicator未导出独立类(Swift 专用 helper;ObjC 通过 IMPOSChatViewController / IMPOSConversationListViewController 定制)
Theme未导出独立类(Swift 专用 helper;ObjC 通过 IMPOSChatViewController / IMPOSConversationListViewController 定制)
IMKitFacadeIMPOSKitFacade

使用约束​

  • 声明中的 `IMP*` 类型与 Swift 的 `IMP*` 类型一一对应(同一个 ObjC 符号,Swift 侧做了重命名)。
  • 回调一律在主线程;不要在里面做重活,必要时切到后台队列后再回主线程更新 UI。
  • `RcResult` 的 `data` 可能为 nil(无返回数据的操作);只用 `code` 判断成功。
  • 未知错误码保留原值,不要映射成 0 或统一文案。

相关:Objective-C 接入、Swift API 参考、状态码。