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))completion | func connect(token: String) async -> RcResult<IMPConnectResult> |
disconnect | - (void)disconnectWithCompletion:(void (^)(IMPOSResult *result))completion | func disconnect() async -> RcResult<Void> |
getConnectionStatus | - (NSInteger)getConnectionStatus | func getConnectionStatus() -> IMPConnectionStatus |
getCurrentUserId | - (NSString *)getCurrentUserId | func getCurrentUserId() -> String |
addEventListener | - (IMPOSListenerToken *)addEventListener:(NSString *)eventName handler:(void (^)(IMPOSEvent *event))handler | func addEventListener(_ event: IMPEvent, listener: IMPEventListener) -> Void |
removeEventListener | - (void)removeEventListener:(IMPOSListenerToken *)token | func 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))completion | func 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))completion | func 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))completion | func 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))completion | func 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))completion | func 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))completion | func 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))completion | func sendTypingStatus(conversationType: IMPConversationType, targetId: String, typing: Bool) async -> RcResult<Void> |
recallMessage | - (void)recallMessageWithMessageId:(NSString *)messageId completion:(void (^)(IMPOSResult *result))completion | func recallMessage(messageId: String) async -> RcResult<IMPMessage> |
sendReadReceipt | - (void)sendReadReceiptWithConversationType:(NSInteger)conversationType targetId:(NSString *)targetId messageIds:(NSArray<NSString *> *)messageIds completion:(void (^)(IMPOSResult *result))completion | func sendReadReceipt(conversationType: IMPConversationType, targetId: String, messageIds: [String]) async -> RcResult<IMPSendReadReceiptResult> |
getMessageReadCount | - (void)getMessageReadCountWithMessageId:(NSString *)messageId completion:(void (^)(IMPOSResult *result))completion | func getMessageReadCount(messageId: String) async -> RcResult<IMPMessageReadCount> |
getMessageReadUsers | - (void)getMessageReadUsersWithMessageId:(NSString *)messageId options:(NSDictionary<NSString *, id> * _Nullable)options completion:(void (^)(IMPOSResult *result))completion | func getMessageReadUsers(messageId: String, options: IMPPageOptions?) async -> RcResult<IMPMessageReadUsers> |
getMessageReadDetail | - (void)getMessageReadDetailWithMessageId:(NSString *)messageId options:(NSDictionary<NSString *, id> * _Nullable)options completion:(void (^)(IMPOSResult *result))completion | func getMessageReadDetail(messageId: String, options: IMPPageOptions?) async -> RcResult<IMPMessageReadDetail> |
searchMessages | - (void)searchMessagesWithOptions:(NSDictionary<NSString *, id> *)options completion:(void (^)(IMPOSResult *result))completion | func searchMessages(options: IMPSearchMessagesOptions) async -> RcResult<IMPMessageSearchResult> |
getConversationList | - (void)getConversationListWithCompletion:(void (^)(IMPOSResult *result))completion | func getConversationList() async -> RcResult<[IMPConversation]> |
getConversation | - (void)getConversationWithConversationType:(NSInteger)conversationType targetId:(NSString *)targetId completion:(void (^)(IMPOSResult *result))completion | func 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))completion | func getHistoryMessages(conversationType: IMPConversationType, targetId: String, options: IMPHistoryOptions?) async -> RcResult<IMPHistoryPage> |
clearUnreadCount | - (void)clearUnreadCountWithConversationType:(NSInteger)conversationType targetId:(NSString *)targetId completion:(void (^)(IMPOSResult *result))completion | func clearUnreadCount(conversationType: IMPConversationType, targetId: String) async -> RcResult<Void> |
setConversationToTop | - (void)setConversationToTopWithConversationType:(NSInteger)conversationType targetId:(NSString *)targetId isTop:(BOOL)isTop completion:(void (^)(IMPOSResult *result))completion | func 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))completion | func saveTextMessageDraft(conversationType: IMPConversationType, targetId: String, draft: String) async -> RcResult<Void> |
getTextMessageDraft | - (void)getTextMessageDraftWithConversationType:(NSInteger)conversationType targetId:(NSString *)targetId completion:(void (^)(IMPOSResult *result))completion | func getTextMessageDraft(conversationType: IMPConversationType, targetId: String) async -> RcResult<String> |
clearTextMessageDraft | - (void)clearTextMessageDraftWithConversationType:(NSInteger)conversationType targetId:(NSString *)targetId completion:(void (^)(IMPOSResult *result))completion | func clearTextMessageDraft(conversationType: IMPConversationType, targetId: String) async -> RcResult<Void> |
setConversationNotificationLevel | - (void)setConversationNotificationLevelWithConversationType:(NSInteger)conversationType targetId:(NSString *)targetId level:(NSInteger)level completion:(void (^)(IMPOSResult *result))completion | func setConversationNotificationLevel(conversationType: IMPConversationType, targetId: String, level: IMPNotificationLevel) async -> RcResult<Void> |
getUserProfile | - (void)getUserProfileWithUserId:(NSString *)userId completion:(void (^)(IMPOSResult *result))completion | func getUserProfile(userId: String) async -> RcResult<IMPUserProfile> |
updateMyUserProfile | - (void)updateMyUserProfileWithProfile:(NSDictionary<NSString *, id> *)profile completion:(void (^)(IMPOSResult *result))completion | func updateMyUserProfile(profile: IMPUserProfileUpdate) async -> RcResult<IMPUserProfile> |
getOnlineStatus | - (void)getOnlineStatusWithUserId:(NSString *)userId completion:(void (^)(IMPOSResult *result))completion | func getOnlineStatus(userId: String) async -> RcResult<IMPUserOnlineStatus> |
getOnlineStatusBatch | - (void)getOnlineStatusBatchWithUserIds:(NSArray<NSString *> *)userIds completion:(void (^)(IMPOSResult *result))completion | func getOnlineStatusBatch(userIds: [String]) async -> RcResult<IMPUserOnlineStatusBatch> |
searchUsers | - (void)searchUsersWithKeyword:(NSString *)keyword options:(NSDictionary<NSString *, id> * _Nullable)options completion:(void (^)(IMPOSResult *result))completion | func searchUsers(keyword: String, options: IMPPageOptions?) async -> RcResult<IMPUserSearchResult> |
sendFriendRequest | - (void)sendFriendRequestWithToUserId:(NSString *)toUserId message:(NSString * _Nullable)message completion:(void (^)(IMPOSResult *result))completion | func sendFriendRequest(toUserId: String, message: String?) async -> RcResult<IMPFriendRequest> |
getFriendRequests | - (void)getFriendRequestsWithOptions:(NSDictionary<NSString *, id> * _Nullable)options completion:(void (^)(IMPOSResult *result))completion | func getFriendRequests(options: IMPFriendRequestQuery?) async -> RcResult<[IMPFriendRequest]> |
acceptFriendRequest | - (void)acceptFriendRequestWithRequestId:(NSString *)requestId completion:(void (^)(IMPOSResult *result))completion | func acceptFriendRequest(requestId: String) async -> RcResult<IMPFriendRequest> |
rejectFriendRequest | - (void)rejectFriendRequestWithRequestId:(NSString *)requestId completion:(void (^)(IMPOSResult *result))completion | func rejectFriendRequest(requestId: String) async -> RcResult<IMPFriendRequest> |
getFriends | - (void)getFriendsWithCompletion:(void (^)(IMPOSResult *result))completion | func getFriends() async -> RcResult<[IMPFriend]> |
deleteFriend | - (void)deleteFriendWithFriendId:(NSString *)friendId completion:(void (^)(IMPOSResult *result))completion | func deleteFriend(friendId: String) async -> RcResult<Void> |
setFriendRemark | - (void)setFriendRemarkWithFriendId:(NSString *)friendId remark:(NSString *)remark completion:(void (^)(IMPOSResult *result))completion | func setFriendRemark(friendId: String, remark: String) async -> RcResult<Void> |
getBlacklist | - (void)getBlacklistWithCompletion:(void (^)(IMPOSResult *result))completion | func getBlacklist() async -> RcResult<[IMPBlacklistEntry]> |
addToBlacklist | - (void)addToBlacklistWithUserId:(NSString *)userId completion:(void (^)(IMPOSResult *result))completion | func addToBlacklist(userId: String) async -> RcResult<Void> |
removeFromBlacklist | - (void)removeFromBlacklistWithUserId:(NSString *)userId completion:(void (^)(IMPOSResult *result))completion | func removeFromBlacklist(userId: String) async -> RcResult<Void> |
createGroup | - (void)createGroupWithOptions:(NSDictionary<NSString *, id> *)options completion:(void (^)(IMPOSResult *result))completion | func createGroup(_ options: IMPCreateGroupOptions) async -> RcResult<IMPGroup> |
getGroupsInfo | - (void)getGroupsInfoWithGroupIds:(NSArray<NSString *> *)groupIds completion:(void (^)(IMPOSResult *result))completion | func getGroupsInfo(groupIds: [String]) async -> RcResult<[IMPGroup]> |
getGroupMembers | - (void)getGroupMembersWithGroupId:(NSString *)groupId completion:(void (^)(IMPOSResult *result))completion | func getGroupMembers(groupId: String) async -> RcResult<[IMPGroupMember]> |
addGroupMembers | - (void)addGroupMembersWithGroupId:(NSString *)groupId userIds:(NSArray<NSString *> *)userIds completion:(void (^)(IMPOSResult *result))completion | func addGroupMembers(groupId: String, userIds: [String]) async -> RcResult<IMPAddGroupMembersResult> |
removeGroupMembers | - (void)removeGroupMembersWithGroupId:(NSString *)groupId userIds:(NSArray<NSString *> *)userIds completion:(void (^)(IMPOSResult *result))completion | func removeGroupMembers(groupId: String, userIds: [String]) async -> RcResult<IMPRemoveGroupMembersResult> |
quitGroup | - (void)quitGroupWithGroupId:(NSString *)groupId completion:(void (^)(IMPOSResult *result))completion | func quitGroup(groupId: String) async -> RcResult<Void> |
updateGroupName | - (void)updateGroupNameWithGroupId:(NSString *)groupId name:(NSString *)name completion:(void (^)(IMPOSResult *result))completion | func updateGroupName(groupId: String, name: String) async -> RcResult<IMPGroup> |
updateGroupNotice | - (void)updateGroupNoticeWithGroupId:(NSString *)groupId notice:(NSString *)notice completion:(void (^)(IMPOSResult *result))completion | func updateGroupNotice(groupId: String, notice: String) async -> RcResult<IMPGroup> |
transferGroupOwner | - (void)transferGroupOwnerWithGroupId:(NSString *)groupId newOwner:(NSString *)newOwner completion:(void (^)(IMPOSResult *result))completion | func transferGroupOwner(groupId: String, newOwner: String) async -> RcResult<IMPGroup> |
addGroupAdmin | - (void)addGroupAdminWithGroupId:(NSString *)groupId userId:(NSString *)userId completion:(void (^)(IMPOSResult *result))completion | func addGroupAdmin(groupId: String, userId: String) async -> RcResult<IMPGroup> |
removeGroupAdmin | - (void)removeGroupAdminWithGroupId:(NSString *)groupId userId:(NSString *)userId completion:(void (^)(IMPOSResult *result))completion | func 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))completion | func muteGroupMember(groupId: String, userId: String, mutedUntil: UInt64) async -> RcResult<IMPMuteGroupMemberResult> |
createChatroom | - (void)createChatroomWithOptions:(NSDictionary<NSString *, id> *)options completion:(void (^)(IMPOSResult *result))completion | func createChatroom(options: IMPCreateChatroomOptions) async -> RcResult<IMPChatroom> |
joinChatroom | - (void)joinChatroomWithChatroomId:(NSString *)chatroomId completion:(void (^)(IMPOSResult *result))completion | func joinChatroom(chatroomId: String) async -> RcResult<IMPChatroom> |
leaveChatroom | - (void)leaveChatroomWithChatroomId:(NSString *)chatroomId completion:(void (^)(IMPOSResult *result))completion | func leaveChatroom(chatroomId: String) async -> RcResult<Void> |
getChatroomInfo | - (void)getChatroomInfoWithChatroomId:(NSString *)chatroomId completion:(void (^)(IMPOSResult *result))completion | func getChatroomInfo(chatroomId: String) async -> RcResult<IMPChatroom> |
getChatroomMembers | - (void)getChatroomMembersWithChatroomId:(NSString *)chatroomId options:(NSDictionary<NSString *, id> * _Nullable)options completion:(void (^)(IMPOSResult *result))completion | func getChatroomMembers(chatroomId: String, options: IMPPageOptions?) async -> RcResult<IMPChatroomMembersPage> |
getSystemMessages | - (void)getSystemMessagesWithOptions:(NSDictionary<NSString *, id> * _Nullable)options completion:(void (^)(IMPOSResult *result))completion | func getSystemMessages(options: IMPHistoryOptions?) async -> RcResult<IMPHistoryPage> |
uploadFile | - (void)uploadFileWithData:(NSData *)data name:(NSString *)name mime:(NSString * _Nullable)mime completion:(void (^)(IMPOSResult *result))completion | func uploadFile(data: Data, name: String, mime: String?) async -> RcResult<IMPUploadResult> |
updateMessageExpansion | - (void)updateMessageExpansionWithMessageId:(NSString *)messageId expansion:(NSDictionary<NSString *, NSString *> *)expansion completion:(void (^)(IMPOSResult *result))completion | func updateMessageExpansion(messageId: String, expansion: [String: String]) async -> RcResult<IMPExpansion> |
removeMessageExpansion | - (void)removeMessageExpansionWithMessageId:(NSString *)messageId keys:(NSArray<NSString *> *)keys completion:(void (^)(IMPOSResult *result))completion | func removeMessageExpansion(messageId: String, keys: [String]) async -> RcResult<IMPExpansion> |
addMessageReaction | - (void)addMessageReactionWithParam:(NSDictionary<NSString *, id> *)param completion:(void (^)(IMPOSResult *result))completion | func addMessageReaction(_ param: IMPUpdateMessageReactionParam) async -> RcResult<IMPMessageReaction> |
removeMessageReaction | - (void)removeMessageReactionWithParam:(NSDictionary<NSString *, id> *)param completion:(void (^)(IMPOSResult *result))completion | func removeMessageReaction(_ param: IMPUpdateMessageReactionParam) async -> RcResult<IMPReactionRemoval> |
batchGetMessageReactionSummaries | - (void)batchGetMessageReactionSummariesWithParam:(NSDictionary<NSString *, id> *)param completion:(void (^)(IMPOSResult *result))completion | func batchGetMessageReactionSummaries(_ param: IMPMessageReactionSummaryQuery) async -> RcResult<[String: [IMPMessageReactionSummary]]> |
getMessageReactions | - (void)getMessageReactionsWithParam:(NSDictionary<NSString *, id> *)param completion:(void (^)(IMPOSResult *result))completion | func getMessageReactions(_ param: IMPGetMessageReactionsParam) async -> RcResult<IMPMessageReactionPage> |
getMessageReactionUsers | - (void)getMessageReactionUsersWithParam:(NSDictionary<NSString *, id> *)param completion:(void (^)(IMPOSResult *result))completion | func getMessageReactionUsers(_ param: IMPGetMessageReactionUsersParam) async -> RcResult<IMPMessageReactionUserPage> |
createConversationTag | - (void)createConversationTagWithParam:(NSDictionary<NSString *, id> *)param completion:(void (^)(IMPOSResult *result))completion | func createConversationTag(_ param: IMPCreateConversationTagParam) async -> RcResult<IMPConversationTag> |
updateConversationTag | - (void)updateConversationTagWithParam:(NSDictionary<NSString *, id> *)param completion:(void (^)(IMPOSResult *result))completion | func updateConversationTag(_ param: IMPUpdateConversationTagParam) async -> RcResult<IMPConversationTag> |
deleteConversationTag | - (void)deleteConversationTagWithTagId:(NSString *)tagId completion:(void (^)(IMPOSResult *result))completion | func deleteConversationTag(tagId: String) async -> RcResult<Void> |
getConversationTags | - (void)getConversationTagsWithCompletion:(void (^)(IMPOSResult *result))completion | func getConversationTags() async -> RcResult<[IMPConversationTag]> |
addConversationsToTag | - (void)addConversationsToTagWithParam:(NSDictionary<NSString *, id> *)param completion:(void (^)(IMPOSResult *result))completion | func addConversationsToTag(_ param: IMPTagConversationsParam) async -> RcResult<IMPConversationTagMembershipResult> |
removeConversationsFromTag | - (void)removeConversationsFromTagWithParam:(NSDictionary<NSString *, id> *)param completion:(void (^)(IMPOSResult *result))completion | func removeConversationsFromTag(_ param: IMPTagConversationsParam) async -> RcResult<IMPConversationTagMembershipResult> |
getConversationsFromTagByPage | - (void)getConversationsFromTagByPageWithParam:(NSDictionary<NSString *, id> *)param completion:(void (^)(IMPOSResult *result))completion | func getConversationsFromTagByPage(_ param: IMPTagConversationsPageParam) async -> RcResult<IMPConversationTagPage> |
getTagsFromConversation | - (void)getTagsFromConversationWithConversationType:(NSInteger)conversationType targetId:(NSString *)targetId completion:(void (^)(IMPOSResult *result))completion | func getTagsFromConversation(conversationType: Int, targetId: String) async -> RcResult<[IMPConversationTag]> |
getUnreadCountByTag | - (void)getUnreadCountByTagWithTagId:(NSString *)tagId completion:(void (^)(IMPOSResult *result))completion | func getUnreadCountByTag(tagId: String) async -> RcResult<IMPConversationTagUnread> |
setConversationToTopInTag | - (void)setConversationToTopInTagWithParam:(NSDictionary<NSString *, id> *)param completion:(void (^)(IMPOSResult *result))completion | func setConversationToTopInTag(_ param: IMPTagTopParam) async -> RcResult<Void> |
deleteConversation | - (void)deleteConversationWithConversationType:(NSInteger)conversationType targetId:(NSString *)targetId completion:(void (^)(IMPOSResult *result))completion | func deleteConversation(conversationType: Int, targetId: String) async -> RcResult<Bool> |
getConversationTypeNotification | - (void)getConversationTypeNotificationWithConversationType:(NSInteger)conversationType completion:(void (^)(IMPOSResult *result))completion | func getConversationTypeNotification(conversationType: Int) async -> RcResult<IMPConversationTypeNotification> |
setConversationTypeNotification | - (void)setConversationTypeNotificationWithConversationType:(NSInteger)conversationType level:(NSInteger)level completion:(void (^)(IMPOSResult *result))completion | func setConversationTypeNotification(conversationType: Int, level: Int) async -> RcResult<IMPConversationTypeNotification> |
startStreamMessage | - (void)startStreamMessageWithParam:(NSDictionary<NSString *, id> *)param completion:(void (^)(IMPOSResult *result))completion | func startStreamMessage(_ param: IMPStartStreamMessageParam) async -> RcResult<IMPStreamMessage> |
appendStreamMessage | - (void)appendStreamMessageWithStreamId:(NSString *)streamId delta:(NSString *)delta seq:(NSNumber * _Nullable)seq completion:(void (^)(IMPOSResult *result))completion | func appendStreamMessage(streamId: String, delta: String, seq: UInt32?) async -> RcResult<IMPStreamMessage> |
completeStreamMessage | - (void)completeStreamMessageWithStreamId:(NSString *)streamId completion:(void (^)(IMPOSResult *result))completion | func completeStreamMessage(streamId: String) async -> RcResult<IMPStreamCompleteResult> |
getStreamMessage | - (void)getStreamMessageWithStreamId:(NSString *)streamId completion:(void (^)(IMPOSResult *result))completion | func getStreamMessage(streamId: String) async -> RcResult<IMPStreamMessage> |
getMessageExpansion | - (void)getMessageExpansionWithMessageId:(NSString *)messageId completion:(void (^)(IMPOSResult *result))completion | func getMessageExpansion(messageId: String) async -> RcResult<IMPMessageExpansion> |
combineMessages | - (IMPOSResult *)combineMessages:(NSArray<NSDictionary<NSString *, id> *> *)messages options:(NSDictionary<NSString *, id> * _Nullable)options | func combineMessages(_ messages: [IMPMessage], options: IMPCombineMessagesOptions?) -> RcResult<IMPCombineContent> |
subscribePresence | - (void)subscribePresenceWithUserIds:(NSArray<NSString *> *)userIds completion:(void (^)(IMPOSResult *result))completion | func subscribePresence(userIds: [String]) async -> RcResult<IMPPresenceSubscription> |
unsubscribePresence | - (void)unsubscribePresenceWithUserIds:(NSArray<NSString *> *)userIds completion:(void (^)(IMPOSResult *result))completion | func unsubscribePresence(userIds: [String]) async -> RcResult<IMPPresenceSubscription> |
getPresenceSubscriptions | - (void)getPresenceSubscriptionsWithCompletion:(void (^)(IMPOSResult *result))completion | func getPresenceSubscriptions() async -> RcResult<IMPPresenceSubscription> |
registerPushToken | - (void)registerPushTokenWithOptions:(NSDictionary<NSString *, id> *)options completion:(void (^)(IMPOSResult *result))completion | func registerPushToken(options: IMPRegisterPushTokenOptions) async -> RcResult<IMPPushToken> |
unregisterPushToken | - (void)unregisterPushTokenWithTokenId:(NSString *)tokenId completion:(void (^)(IMPOSResult *result))completion | func unregisterPushToken(tokenId: String) async -> RcResult<IMPUnregisterPushTokenResult> |
getPushTokens | - (void)getPushTokensWithCompletion:(void (^)(IMPOSResult *result))completion | func getPushTokens() async -> RcResult<IMPPushTokenListResult> |
createSupergroupChannel | - (void)createSupergroupChannelWithParams:(NSDictionary<NSString *, id> *)params completion:(void (^)(IMPOSResult *result))completion | func createSupergroupChannel(params: IMPCreateSupergroupChannelParams) async -> RcResult<IMPSupergroupChannel> |
listSupergroupChannels | - (void)listSupergroupChannelsWithGroupId:(NSString *)groupId completion:(void (^)(IMPOSResult *result))completion | func listSupergroupChannels(groupId: String) async -> RcResult<IMPSupergroupChannelListResult> |
joinSupergroupChannel | - (void)joinSupergroupChannelWithChannelId:(NSString *)channelId options:(NSDictionary<NSString *, id> * _Nullable)options completion:(void (^)(IMPOSResult *result))completion | func joinSupergroupChannel(channelId: String, options: IMPSupergroupChannelOptions?) async -> RcResult<IMPJoinSupergroupChannelResult> |
leaveSupergroupChannel | - (void)leaveSupergroupChannelWithChannelId:(NSString *)channelId options:(NSDictionary<NSString *, id> * _Nullable)options completion:(void (^)(IMPOSResult *result))completion | func 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))completion | func bindUserGroupToChannel(channelId: String, userGroupId: String, options: IMPSupergroupChannelOptions?) async -> RcResult<IMPBindUserGroupToChannelResult> |
createUserGroup | - (void)createUserGroupWithParams:(NSDictionary<NSString *, id> *)params completion:(void (^)(IMPOSResult *result))completion | func createUserGroup(params: IMPCreateUserGroupParams) async -> RcResult<IMPUserGroup> |
listUserGroups | - (void)listUserGroupsWithGroupId:(NSString *)groupId completion:(void (^)(IMPOSResult *result))completion | func listUserGroups(groupId: String) async -> RcResult<IMPUserGroupListResult> |
getUserGroupsByUser | - (void)getUserGroupsByUserWithUserId:(NSString *)userId options:(NSDictionary<NSString *, id> * _Nullable)options completion:(void (^)(IMPOSResult *result))completion | func getUserGroupsByUser(userId: String, options: IMPSupergroupChannelOptions?) async -> RcResult<IMPUserGroupListResult> |
与 SDK ObjC 表面的交叉校验
| 项 | 数量 / 值 | 说明 |
|---|---|---|
| IDL 语义操作 | 103 | sdk-imlib.json 的操作全集 |
| ObjC 表面声明 | 103 / 103 | SDK 产出的 ObjC 表面 methodMap 覆盖数 |
| 工厂 / 事件 API | 3 | init / addEventListener / removeEventListener 的专门形态(工厂、eventApi) |
| 按 IDL 规则补充 | 0 | 无需补充 |
| 表面声明校验 | 0 处待修正 | 全部声明可解析 |
| 声明来源 | SDK 产物(objc-surface) | 页面生成时读取,不手写 |
上述交叉校验在每次生成时执行:表面缺失的操作会回退到 IDL 命名规则,并在上表列出;表面存在时以表面声明为准。
IMKit 组件 ObjC 表面
| 组件 | ObjC 声明 / 符号 |
|---|---|
ConversationListView | IMPOSClient · init |
ChatView | IMPOSClient · 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 定制) |
IMKitFacade | IMPOSKitFacade |
使用约束
- 声明中的 `IMP*` 类型与 Swift 的 `IMP*` 类型一一对应(同一个 ObjC 符号,Swift 侧做了重命名)。
- 回调一律在主线程;不要在里面做重活,必要时切到后台队列后再回主线程更新 UI。
- `RcResult` 的 `data` 可能为 nil(无返回数据的操作);只用 `code` 判断成功。
- 未知错误码保留原值,不要映射成 0 或统一文案。