我的CloudKit应用程序中的CKContainer.discoverAllIdentities请求总是失败.它在几天的过程中不断失败.
@H_403_12@private func getContacts(completion: (([CKUserIdentity]?) -> Void)?) { container.status(forApplicationPermission: .userDiscoverability) { [weak self] status,error in if let error = error { print(error) } switch status { case .granted: self?.discover(completion: completion) default: print("status not granted") } } } private func discover(completion: (([CKUserIdentity]?) -> Void)?) { let op = CKDiscoverAllUserIdentitiesOperation() op.qualityOfService = .userInitiated op.discoverAllUserIdentitiesCompletionBlock = { error in if let error = error { print(error) } } op.userIdentityDiscoveredBlock = { identity in print(identity) } op.start() }
它会导致错误传递给op.discoverAllUserIdentitiesCompletionBlock.日志中的错误描述是:
< CKError 0x1c4a51a60:“服务器拒绝请求”(15/2000); server message =“内部服务器错误”; uuid = F67453B9-712D-4E5E-9335-929123E3C978; container ID =“iCloud.com.huntermaximillionmonk.topdraw”>