Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

CloudKit public database not working unless I login to iCloud

I'm trying to read data from the public database using CloudKit.

let publicDB = CKContainer.defaultContainer().publicCloudDatabase
let query = ...
publicDB.performQuery(query, inZoneWithID: nil) { results, error in
    // "Internal Error" (1/1000); "Received a didCompleteWithError without receiving a response from the server">)
}

However, once I login to iCloud, I get the data back as expected. Per the documentation, one should be able to access Public DB related records without being logged in, correct?

One thing to note, is that I am using the simulator.

like image 572
Adam Johnson Avatar asked Sep 22 '15 06:09

Adam Johnson


People also ask

Do CloudKit apps sync with iCloud users?

Sync user data between multiple apps from the same developer If you have a suite of apps, they can all share the same CloudKit container so users can have access to their data for all of your apps on every device they have associated with their iCloud account.

Where is CloudKit data stored?

You use CloudKit to store your app's existing data in the cloud so that the user can access it on multiple devices. You can also store data in a public area where all users can access it.

Do you need to pay for CloudKit?

Yes you will require paid developer account for CloudKit. Initially, they do give free storage for testing or development purpose but when it grows more you will require to Pay.

What is http Apple CloudKit com?

Overview. CloudKit is designed for manageability, flexibility, and power. By organizing apps in containers, CloudKit ensures each app is siloed so its data won't get entangled with other apps. Specialized databases and zones also let you easily separate app information by access type or function.


1 Answers

Looks like I missed this part of the documentation:

In development, when you run your app through Xcode on iOS Simulator or an iOS device, you also need to enter iCloud credentials to read records in the public database.

Apple Documentation

like image 112
Adam Johnson Avatar answered Sep 23 '22 17:09

Adam Johnson