I am working with the CKDiscoverAllUserIdentitiesOperation. I would like to fetch all users, however, CloudKit returns the following error: <CKError 0x6000009ce040: "Request Rate Limited" (7/2058); "Operation throttled by previous server http 429 reply. Retry after 6432.8 seconds. (Other operations may be allowed.)"; Retry after 6432.8 seconds> Here's my code:
var identities = [CKUserIdentity]()
let operation = CKDiscoverAllUserIdentitiesOperation()
operation.userIdentityDiscoveredBlock = { userIdentity in
identities.append(userIdentity)
}
operation.discoverAllUserIdentitiesCompletionBlock = { error in
if let error = error {
fatalError(error.localizedDescription)
} else {
completion(identities)
}
}
operation.qualityOfService = .userInitiated
CKContainer.default().add(operation)
App adds that operation in the viewDidAppear method . Also I have requested to the application permission for user discoverability (accodring to the Apple's documentation: https://developer.apple.com/documentation/cloudkit/ckdiscoveralluseridentitiesoperato)