Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

waterskier2007

macrumors 68000
Original poster
Jun 19, 2007
1,877
243
Novi, MI
EDIT: Ok, so I realize that I screwed up in forgetting that anonymous access to the publicDatabase would be read only. Along those lines, I can't access the container that should have been created through the CloudKit Dashboard. If anyone has any experience doing this, that would be great.

------------------------------------------------------------------------------------------------
I know it is in beta, so I don't expect everything to be perfect, but I cannot for the life of me get CloudKit working. I am trying to use a public CloudKit database for a test app I am working on. In the developer portal I have set up the iCloud container. In my app I have enabled the iCloud capability like the document says to do here. Through debugging I can get a reference to my CKContainer and CKDatabase (the public one). When I go to save a record however, I get back the error "Not Authenticated" - "Account couldn't get container scoped user id, no underlying error received"

This is weird though, because in their docs, it states: "For a running Cloud Kit app, access to a container’s public database requires only access to the network"

Anyone have any thoughts/ideas?

Code is below (forgive typos, I am retyping)

Code:
CKContainer *cont = [CKContainer defaultContainer];
CKDatabase *db = [cont pulicCloudDatabase];

CKRecord *rec = [[CKRecord alloc] initWithRecordType:@"myTestRecord"];
[rec setObject:@"test" forKey:@"testKey"];
[db saveRecord...]
 
Last edited:
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.