Questions tagged [cloudkit]

CloudKit is a framework for storing and retrieving data on Apple’s iCloud servers. Queries can be run against structured records on the server, and assets provide for large data storage. The public database provides shared storage for web-style apps, and the private database provides storage for user-specific data. CloudKit also provides a user identity so that an iCloud account can be used for sign-in for your app.

CloudKit

CloudKit is a framework for storing and retrieving data on Apple’s iCloud servers. Queries can be run against structured records on the server, and assets provide for large data storage.

The public database provides shared storage for web-style apps, and the private database provides storage for user-specific data.

CloudKit also provides a user identity so that an iCloud account can be used for sign-in for your app.

CloudKit is a transfer mechanism rather than a full sync solution, but it can be used to build custom syncing solutions.

Resources

2317 questions
23
votes
2 answers

How can I make a CKQuery without predicate?

I need to query all the record types, without any filtering. I tried two ways: let query = CKQuery(recordType: "Pm", predicate: nil) let query = CKQuery(recordType: "Pm", predicate: NSPredicate(format: "")) I got…
János
  • 32,867
  • 38
  • 193
  • 353
20
votes
2 answers

How (and when) do I use iCloud's encodeSystemFields method on CKRecord?

encodeSystemFields is supposed to be used when I keep records locally, in a database. Once I export that data, must I do anything special when de-serializing it? What scenarios should I act upon information in that data? As a variation (and if not…
makerofthings7
  • 60,103
  • 53
  • 215
  • 448
20
votes
1 answer

Is there an API for iCloud disk capacity and usage?

I use NSFileManager to get the current device disk space (total, used, and free) like so... let systemAttributes = try? NSFileManager.defaultManager().attributesOfFileSystemForPath(NSHomeDirectory() as String) let space =…
W Dyson
  • 4,604
  • 4
  • 40
  • 68
20
votes
1 answer

Verify backend calls from iOS app

I am trying to find an equivalent of this Android verification but for iOS. Initially posted in a blog post but now incorporated into the main android documentation, the verification lets you know 3 things: Then, you know that: The token was…
20
votes
7 answers

Saving CloudKit Record "Not Authenticated" (9/1002)" "This request requires an authenticated account""

Saving a CKRecord in the simulator gives me the following error: [publicDatabase saveRecord:cloudRouteEntity completionHandler:^(CKRecord *record, NSError *error) { if (error) { NSLog(@"An error occured in %@: %@",…
brainray
  • 12,512
  • 11
  • 67
  • 116
19
votes
1 answer

How to make remote notifications work with CloudKit Subscriptions?

So far I was unable to make subscriptions to work. (receive a push notification on my device, subscriptions appears to be created successfully) I have been playing with [CloudKitAtlas][1]. I did what it's told on the readme for that…
dev_jac
  • 825
  • 9
  • 17
18
votes
1 answer

Disable CloudKit debugging logs

I am using a NSPersistentCloudKitContainer for the database in my iOS app. By default it seems to log all events to the console, I am assuming for debugging purposes. These messages look like this: CoreData: CloudKit: CoreData+CloudKit:…
Carl
  • 683
  • 5
  • 18
18
votes
1 answer

Not receiving CloudKit push notifications

I'm writing a small app that uses CloudKit. For some reason the app doesn't receive any notifications when there's a new record matching the query. Has anyone been able to get this feature to work? I create new records in the app, but also in the…
TotoroTotoro
  • 17,524
  • 4
  • 45
  • 76
17
votes
7 answers

The application is missing required entitlement com.apple.developer.icloud-services'

I'm using a public iCloud database in my app, which works great and is up on the store. On updating my app to a new version (with Xcode 7 on iOS9) I get a crash on the line : CKContainer * container = [CKContainer…
olynoise
  • 2,016
  • 2
  • 19
  • 32
17
votes
2 answers

CloudKit count records

I have a "table" that can potentially have many records, when adding a new record I need to know how many records there already are in current table as I use it in calculation of some values. The closest thing I could find is requesting all entries…
Dennis Sedov
  • 171
  • 1
  • 3
16
votes
5 answers

NSPersistentStoreRemoteChangeNotification not getting fired

I am trying to perform history tracking in my CoreData+CloudKit project which uses NSPersistentCloudKitContainer. I have been following along with Apple's sample project I want to perform certain task when the remote store has been updated. For this…
FE_Tech
  • 1,534
  • 13
  • 25
16
votes
3 answers

Share Core Data between users with NSPersistentCloudKitContainer

Apple introduced the NSPersistentCloudKitContainer with iOS 13 which enable us to use CloudKit with Core Data. I got it working pretty much instantly on different devices but my main issue is still left. Is it possible to share the data in an easy…
Jonas
  • 1,112
  • 5
  • 17
  • 28
16
votes
2 answers

"Couldn't send a valid signature" error when using CloudKit

Anyone know what could be causing this error which is returned in the query block below: Here is my code snippet: CKContainer *container = [CKContainer…
croc_hunter
  • 285
  • 3
  • 12
16
votes
4 answers

Private data sharing using CloudKit

Is there a straightforward way to share private data between two or more users using CloudKit? Public and private date are obvious, but there doesn't seem to be a way to allow a group of users to organize their own silo to share data amongst…
hashemi
  • 2,608
  • 1
  • 25
  • 31
16
votes
2 answers

CloudKit public database reading without iCloud login

In the documents it says that CloudKit public databases will be available to read even if the user did not login with a proper iCloud account. However, I cannot fetch anything from my cloud database if i didn't connect my iOS simulator or device to…
Ersin Sezgin
  • 640
  • 5
  • 15