Anyone know what could be causing this error which is returned in the query block below:
<CKError 0x7f8d5ba27a10: "Internal Error" (1/4000); "Couldn't send a valid signature">
Here is my code snippet:
CKContainer *container = [CKContainer defaultContainer];
CKDatabase *publicDatabase = [container publicCloudDatabase];
//CKDatabase *publicDatabase = [[CKContainer containerWithIdentifier:container] publicCloudDatabase];
NSPredicate *predicate = [NSPredicate predicateWithFormat:@"doctorName = %@", @"Dr. Harry White"];
CKQuery *query = [[CKQuery alloc] initWithRecordType:@"WellnessTest" predicate:predicate];
[publicDatabase performQuery:query inZoneWithID:nil completionHandler:^(NSArray *results, NSError *error)
{
if (error)
{
// Error handling for failed fetch from public database
NSLog(@"ERROR: %@", error.description);
}
else
{
// Display the fetched records
NSLog(@"Results: %@", results.description);
}
}];
On the iPhone/iPad simulator go to Settings > iCloud and then log in using your Apple ID.
If you're testing your app against CloudKit's Production environment, you may still have this error even if you have signed into iCloud on the simulator. In this case, running your app on a device would fix the error.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With