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.
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.
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.
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.
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.
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
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