提交工单
咨询集成、功能及报价等问题
本文介绍 ZIM iOS 平台 SDK 版本升级时的一些说明和注意事项。
从 2.16.0 版本开始,以下接口有重大变更,因此在从旧版本升级到 2.16.0 版本时,请您阅读以下指南。
以下变更仅对进阶模式呼叫邀请而言。
在新版本的 callCancelWithInvitees 中,如果参数 userIDs 包含一个 userID,则该接口将仅取消邀请该被叫用户。如果 userIDs 参数为空,则该接口将对所有被叫用户取消邀请。
而对于旧版本的 callCancelWithInvitees
接口,无论参数 userIDs 是否为空,均视为对所有被叫用户取消邀请。
由于旧版 ZIM SDK 不兼容单独取消逻辑,因此如果您既需要保留使用老版本 ZIM 实现的取消逻辑,又需要使用新版本的单独取消功能,请隔离新老版本 ZIM 之间的呼叫功能。
ZIMCallCancelConfig *cancelConfig = [[ZIMCallCancelConfig alloc] init];
// 单独取消 userIdA 、userIdB
[[ZIM getInstance] callCancelWithInvitees:@[@"userIdA",@"userIdB"] callID:@"callId" config:cancelConfig callback:^(NSString * _Nonnull callID, NSArray<NSString *> * _Nonnull errorInvitees, ZIMError * _Nonnull errorInfo) {
}];
// 取消整个呼叫邀请,当整个呼叫中所有被叫都未接受时可以调用成功
[[ZIM getInstance] callCancelWithInvitees:@[] callID:@"callId" config:cancelConfig callback:^(NSString * _Nonnull callID, NSArray<NSString *> * _Nonnull errorInvitees, ZIMError * _Nonnull errorInfo) {
}];
ZIMCallCancelConfig *cancelConfig = [[ZIMCallCancelConfig alloc] init];
// 无论 userIDs 中是否传递 userID,均为取消整个呼叫,当整个呼叫中所有被叫都未接受时可以调用成功
[[ZIM getInstance] callCancelWithInvitees:@[@"userIdA",@"userIdB"] callID:@"callId" config:cancelConfig callback:^(NSString * _Nonnull callID, NSArray<NSString *> * _Nonnull errorInvitees, ZIMError * _Nonnull errorInfo) {
}];
// 取消整个呼叫邀请,当整个呼叫中所有被叫都未接受时可以调用成功
[[ZIM getInstance] callCancelWithInvitees:@[] callID:@"callId" config:cancelConfig callback:^(NSString * _Nonnull callID, NSArray<NSString *> * _Nonnull errorInvitees, ZIMError * _Nonnull errorInfo) {
}];
ZIM SDK 在 2.5.0 版本对 Swift 语言接口做了命名优化,因此在从旧版本升级到 2.5.0 版本时,请您阅读以下所列的新旧接口名称变更情况。
//老接口
open class func getInstance() -> ZIM
//新接口
open class func shared() -> ZIM?
//老接口
open class func create(with config: ZIMAppConfig) -> ZIM
//新接口
open class func create(with config: ZIMAppConfig) -> ZIM?
//老接口
open class func setAdvancedConfigWithKey(_ key: String, value: String)
//新接口
open class func setAdvancedConfig(key: String, value: String)
//老接口
open func uploadLog(_ callback: @escaping ZIMLogUploadedCallback)
//新接口
open func uploadLog(with callback: @escaping ZIMLogUploadedCallback)
//老接口
open func queryUsersInfo(_ userIDs: [String], config: ZIMUsersInfoQueryConfig, callback: @escaping ZIMUsersInfoQueriedCallback)
//新接口
open func queryUsersInfo(by userIDs: [String], config: ZIMUsersInfoQueryConfig, callback: @escaping ZIMUsersInfoQueriedCallback)
//老接口
open func deleteConversation(_ conversationID: String, conversationType: ZIMConversationType, config: ZIMConversationDeleteConfig, callback: @escaping ZIMConversationDeletedCallback)
//新接口
open func deleteConversation(by conversationID: String, conversationType: ZIMConversationType, config: ZIMConversationDeleteConfig, callback: @escaping ZIMConversationDeletedCallback)
//老接口
open func clearConversationUnreadMessageCount(_ conversationID: String, conversationType: ZIMConversationType, callback: @escaping ZIMConversationUnreadMessageCountClearedCallback)
//新接口
open func clearConversationUnreadMessageCount(for conversationID: String, conversationType: ZIMConversationType, callback: @escaping ZIMConversationUnreadMessageCountClearedCallback)
//老接口
open func send(_ message: ZIMMessage, toConversationID: String, conversationType: ZIMConversationType, config: ZIMMessageSendConfig, notification: ZIMMessageSendNotification?, callback: @escaping ZIMMessageSentCallback)
//新接口
open func sendMessage(_ message: ZIMMessage, toConversationID: String, conversationType: ZIMConversationType, config: ZIMMessageSendConfig, notification: ZIMMessageSendNotification?, callback: @escaping ZIMMessageSentCallback)
//老接口
@available(*, deprecated, message: "Deprecated since ZIM 2.4.0, please use another [sendMediaMessage] instead")
open func send(_ message: ZIMMediaMessage, toConversationID: String, conversationType: ZIMConversationType, config: ZIMMessageSendConfig, progress: @escaping ZIMMediaUploadingProgress, callback: @escaping ZIMMessageSentCallback)
//新接口
@available(*, deprecated, message: "Deprecated since ZIM 2.4.0, please use another [sendMediaMessage] instead")
open func sendMediaMessage(_ message: ZIMMediaMessage, toConversationID: String, conversationType: ZIMConversationType, config: ZIMMessageSendConfig, progress: @escaping ZIMMediaUploadingProgress, callback: @escaping ZIMMessageSentCallback)
//老接口
open func send(_ message: ZIMMediaMessage, toConversationID: String, conversationType: ZIMConversationType, config: ZIMMessageSendConfig, notification: ZIMMediaMessageSendNotification?, callback: @escaping ZIMMessageSentCallback)
//新接口
open func sendMediaMessage(_ message: ZIMMediaMessage, toConversationID: String, conversationType: ZIMConversationType, config: ZIMMessageSendConfig, notification: ZIMMediaMessageSendNotification?, callback: @escaping ZIMMessageSentCallback)
//老接口
open func queryHistoryMessage(byConversationID conversationID: String, conversationType: ZIMConversationType, config: ZIMMessageQueryConfig, callback: @escaping ZIMMessageQueriedCallback)
//新接口
open func queryHistoryMessage(by conversationID: String, conversationType: ZIMConversationType, config: ZIMMessageQueryConfig, callback: @escaping ZIMMessageQueriedCallback)
//老接口
open func deleteAllMessage(byConversationID conversationID: String, conversationType: ZIMConversationType, config: ZIMMessageDeleteConfig, callback: @escaping ZIMMessageDeletedCallback)
//新接口
open func deleteAllMessage(by conversationID: String, conversationType: ZIMConversationType, config: ZIMMessageDeleteConfig, callback: @escaping ZIMMessageDeletedCallback)
//老接口
open func delete(_ messageList: [ZIMMessage], conversationID: String, conversationType: ZIMConversationType, config: ZIMMessageDeleteConfig, callback: @escaping ZIMMessageDeletedCallback)
//新接口
open func deleteMessages(_ messageList: [ZIMMessage], conversationID: String, conversationType: ZIMConversationType, config: ZIMMessageDeleteConfig, callback: @escaping ZIMMessageDeletedCallback)
//老接口
open func insertMessage(toLocalDB message: ZIMMessage, conversationID: String, conversationType: ZIMConversationType, senderUserID: String, callback: @escaping ZIMMessageInsertedCallback)
//新接口
open func insertMessageToLocalDB(_ message: ZIMMessage, conversationID: String, conversationType: ZIMConversationType, senderUserID: String, callback: @escaping ZIMMessageInsertedCallback)
//老接口
open func createRoom(_ roomInfo: ZIMRoomInfo, callback: @escaping ZIMRoomCreatedCallback)
//新接口
open func createRoom(with roomInfo: ZIMRoomInfo, callback: @escaping ZIMRoomCreatedCallback)
//老接口
open func createRoom(_ roomInfo: ZIMRoomInfo, config: ZIMRoomAdvancedConfig, callback: @escaping ZIMRoomCreatedCallback)
//新接口
open func createRoom(with roomInfo: ZIMRoomInfo, config: ZIMRoomAdvancedConfig, callback: @escaping ZIMRoomCreatedCallback)
//老接口
open func joinRoom(_ roomID: String, callback: @escaping ZIMRoomJoinedCallback)
//新接口
open func joinRoom(by roomID: String, callback: @escaping ZIMRoomJoinedCallback)
//老接口
open func enterRoom(_ roomInfo: ZIMRoomInfo, config: ZIMRoomAdvancedConfig?, callback: @escaping ZIMRoomEnteredCallback)
//新接口
open func enterRoom(with roomInfo: ZIMRoomInfo, config: ZIMRoomAdvancedConfig?, callback: @escaping ZIMRoomEnteredCallback)
//老接口
open func leaveRoom(_ roomID: String, callback: @escaping ZIMRoomLeftCallback)
//新接口
open func leaveRoom(by roomID: String, callback: @escaping ZIMRoomLeftCallback)
//老接口
open func queryRoomMemberList(byRoomID roomID: String, config: ZIMRoomMemberQueryConfig, callback: @escaping ZIMRoomMemberQueriedCallback)
//新接口
open func queryRoomMemberList(by roomID: String, config: ZIMRoomMemberQueryConfig, callback: @escaping ZIMRoomMemberQueriedCallback)
//老接口
open func queryRoomOnlineMemberCount(byRoomID roomID: String, callback: @escaping ZIMRoomOnlineMemberCountQueriedCallback)
//新接口
open func queryRoomOnlineMemberCount(by roomID: String, callback: @escaping ZIMRoomOnlineMemberCountQueriedCallback)
//老接口
open func beginRoomAttributesBatchOperation(withRoomID roomID: String, config: ZIMRoomAttributesBatchOperationConfig?)
//新接口
open func beginRoomAttributesBatchOperation(with roomID: String, config: ZIMRoomAttributesBatchOperationConfig?)
//老接口
open func endRoomAttributesBatchOperation(withRoomID roomID: String, callback: @escaping ZIMRoomAttributesBatchOperatedCallback)
//新接口
open func endRoomAttributesBatchOperation(with roomID: String, callback: @escaping ZIMRoomAttributesBatchOperatedCallback)
//老接口
open func queryRoomAllAttributes(byRoomID roomID: String, callback: @escaping ZIMRoomAttributesQueriedCallback)
//新接口
open func queryRoomAllAttributes(by roomID: String, callback: @escaping ZIMRoomAttributesQueriedCallback)
//老接口
open func queryRoomMembersAttributes(byUserIDs userIDs: [String], roomID: String, callback: @escaping ZIMRoomMembersAttributesQueriedCallback)
//新接口
open func queryRoomMembersAttributes(by userIDs: [String], roomID: String, callback: @escaping ZIMRoomMembersAttributesQueriedCallback)
//老接口
open func queryRoomMemberAttributesList(byRoomID roomID: String, config: ZIMRoomMemberAttributesQueryConfig, callback: @escaping ZIMRoomMemberAttributesListQueriedCallback)
//新接口
open func queryRoomMemberAttributesList(by roomID: String, config: ZIMRoomMemberAttributesQueryConfig, callback: @escaping ZIMRoomMemberAttributesListQueriedCallback)
//老接口
open func createGroup(_ groupInfo: ZIMGroupInfo, userIDs: [String], callback: @escaping ZIMGroupCreatedCallback)
//新接口
open func createGroup(with groupInfo: ZIMGroupInfo, userIDs: [String], callback: @escaping ZIMGroupCreatedCallback)
//老接口
open func createGroup(_ groupInfo: ZIMGroupInfo, userIDs: [String], config: ZIMGroupAdvancedConfig, callback: @escaping ZIMGroupCreatedCallback)
//新接口
open func createGroup(with groupInfo: ZIMGroupInfo, userIDs: [String], config: ZIMGroupAdvancedConfig, callback: @escaping ZIMGroupCreatedCallback)
//老接口
open func dismissGroup(_ groupID: String, callback: @escaping ZIMGroupDismissedCallback)
//新接口
open func dismissGroup(by groupID: String, callback: @escaping ZIMGroupDismissedCallback)
//老接口
open func joinGroup(_ groupID: String, callback: @escaping ZIMGroupJoinedCallback)
//新接口
open func joinGroup(by groupID: String, callback: @escaping ZIMGroupJoinedCallback)
//老接口
open func leaveGroup(_ groupID: String, callback: @escaping ZIMGroupLeftCallback)
//新接口
open func leaveGroup(by groupID: String, callback: @escaping ZIMGroupLeftCallback)
//老接口
open func inviteUsers(intoGroup userIDs: [String], groupID: String, callback: @escaping ZIMGroupUsersInvitedCallback)
//新接口
open func inviteUsersIntoGroup(with userIDs: [String], groupID: String, callback: @escaping ZIMGroupUsersInvitedCallback)
//老接口
open func kickGroupMembers(_ userIDs: [String], groupID: String, callback: @escaping ZIMGroupMemberKickedCallback)
//新接口
open func kickGroupMembers(by userIDs: [String], groupID: String, callback: @escaping ZIMGroupMemberKickedCallback)
//老接口
open func transferGroupOwner(toUserID: String, groupID: String, callback: @escaping ZIMGroupOwnerTransferredCallback)
//新接口
open func transferGroupOwner(to toUserID: String, groupID: String, callback: @escaping ZIMGroupOwnerTransferredCallback)
//老接口
open func queryGroupInfo(byGroupID groupID: String, callback: @escaping ZIMGroupInfoQueriedCallback)
//新接口
open func queryGroupInfo(by groupID: String, callback: @escaping ZIMGroupInfoQueriedCallback)
//老接口
open func deleteGroupAttributes(byKeys keys: [String], groupID: String, callback: @escaping ZIMGroupAttributesOperatedCallback)
//新接口
open func deleteGroupAttributes(by keys: [String], groupID: String, callback: @escaping ZIMGroupAttributesOperatedCallback)
//老接口
open func queryGroupAttributes(byKeys keys: [String], groupID: String, callback: @escaping ZIMGroupAttributesQueriedCallback)
//新接口
open func queryGroupAttributes(by keys: [String], groupID: String, callback: @escaping ZIMGroupAttributesQueriedCallback)
//老接口
open func queryGroupAllAttributes(byGroupID groupID: String, callback: @escaping ZIMGroupAttributesQueriedCallback)
//新接口
open func queryGroupAllAttributes(by groupID: String, callback: @escaping ZIMGroupAttributesQueriedCallback)
//老接口
open func queryGroupMemberInfo(byUserID userID: String, groupID: String, callback: @escaping ZIMGroupMemberInfoQueriedCallback)
//新接口
open func queryGroupMemberInfo(by userID: String, groupID: String, callback: @escaping ZIMGroupMemberInfoQueriedCallback)
//老接口
open func queryGroupMemberList(byGroupID groupID: String, config: ZIMGroupMemberQueryConfig, callback: @escaping ZIMGroupMemberListQueriedCallback)
//新接口
open func queryGroupMemberList(by groupID: String, config: ZIMGroupMemberQueryConfig, callback: @escaping ZIMGroupMemberListQueriedCallback)
//老接口
open func queryGroupMemberCount(byGroupID groupID: String, callback: @escaping ZIMGroupMemberCountQueriedCallback)
//新接口
open func queryGroupMemberCount(by groupID: String, callback: @escaping ZIMGroupMemberCountQueriedCallback)
//老接口
open func callInvite(withInvitees invitees: [String], config: ZIMCallInviteConfig, callback: @escaping ZIMCallInvitationSentCallback)
//新接口
open func callInvite(with invitees: [String], config: ZIMCallInviteConfig, callback: @escaping ZIMCallInvitationSentCallback)
//老接口
open func callCancel(withInvitees invitees: [String], callID: String, config: ZIMCallCancelConfig, callback: @escaping ZIMCallCancelSentCallback)
//新接口
open func callCancel(with invitees: [String], callID: String, config: ZIMCallCancelConfig, callback: @escaping ZIMCallCancelSentCallback)
//老接口
open func callAccept(withCallID callID: String, config: ZIMCallAcceptConfig, callback: @escaping ZIMCallAcceptanceSentCallback)
//新接口
open func callAccept(with callID: String, config: ZIMCallAcceptConfig, callback: @escaping ZIMCallAcceptanceSentCallback)
//老接口
open func callReject(withCallID callID: String, config: ZIMCallRejectConfig, callback: @escaping ZIMCallRejectionSentCallback)
//新接口
open func callReject(with callID: String, config: ZIMCallRejectConfig, callback: @escaping ZIMCallRejectionSentCallback)
联系我们
文档反馈