Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I use assets in CloudKit?

I'm trying to use CloudKit with assets.

I created RecordType includes an asset in iCloud developer dashboard.

Then, I created a record in default zone of public database and uploaded a file to the record's asset.

I wrote this code to get the record.

CKContainer *defaultContainer =[CKContainer defaultContainer];
CKDatabase *publicDatabase = [defaultContainer publicCloudDatabase];
CKRecordID *wellKnownID = [[CKRecordID alloc]
                           initWithRecordName:@"RECORDKEY"];

[publicDatabase fetchRecordWithID:wellKnownID
                completionHandler:^(CKRecord *fetchedParty, NSError *error) {
                    NSLog(@"erorr : %@", error)
                }];

And I got this error message.

2014-06-28 21:42:50.148 AppName[10634:1068121] erorr : <CKError 0xc81b4a0: "Internal Error" (1/5001); "Record <CKRecordID: 0xc035b50; RECORDKEY:(_defaultZone:__defaultOwner__)> has items that require encryption but no protection data was found on the record">

What is "protection data"? Should I encrypt data before upload?

like image 585
user3786678 Avatar asked Jun 28 '14 21:06

user3786678


1 Answers

Did you upload the data using the web console? I've experienced this too when doing that. So far my workaround has been to upload the assets using a device and then using them as normal.

like image 58
Mike Katz Avatar answered Oct 13 '22 01:10

Mike Katz