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
12
votes
0 answers

iCloud Drive REST API?

I'm writing Windows C++ application that gives user ability to save some work results directly to cloud storage like Google Drive, Dropbox and OneDrive. I've been able to create working implementation of code that uses OAuth2 and REST API to…
Adrian
  • 149
  • 1
  • 8
12
votes
1 answer

How to receive CloudKit notifications about changes made on record shared with me?

I have two iCloud accounts (A and B) on two different devices. From one of them (A) I share ckrecord to another one (B) like this: let controller = UICloudSharingController { controller, preparationCompletionHandler in …
Bartłomiej Semańczyk
  • 59,234
  • 49
  • 233
  • 358
12
votes
2 answers

Getting addresses from iCloud contacts via CloudKit JS

I want my web application allow to import user contacts (particularly addresses) from iCloud contacts. Something similar to what Google People API provides for Google Contacts. The scenario is that, a user comes to my site using a desktop browser…
user3697159
  • 121
  • 6
12
votes
2 answers

How do I fetch all CloudKit Records created by the current user?

Say I have a 'Species' Record Type that contains Public Records which were created by a number of Users. Currently, my query retrieves all records of 'Species': private func fetchSpecies() { // Fetch Public Database let publicDatabase =…
Matt Mac
  • 437
  • 8
  • 22
12
votes
2 answers

CloudKit CKSubscription without notifications?

I'm writing a Swift app with CloudKit. When a record is modified in CloudKit by a device, I want the corresponding records to be updated in the local storage of the other devices without displaying a push notification. Do I need to call…
franswa
  • 836
  • 1
  • 9
  • 21
12
votes
2 answers

iOS 9 CloudKit: query does not return anything while connected to cellular network

I'm developing an app with xcode 7 beta 5. When i run my app on my iphone 6 and i try to connect it to CloudKit if my iphone works in wifi mode all it's ok, i display all my data; but if my iphone works in LTE mode i can't see any kind of data. Does…
Alessio Chiappe
  • 145
  • 1
  • 9
12
votes
2 answers

CloudKit share Data between different iCloud accounts but not with everyone

In my app I want to share data via iCloud with other iCloud users but not with the whole world but with selected other iCloud users. I thought about a way this could work, but I am not sure if it will work and if I forgot or misunderstood some…
Kreuzberg
  • 894
  • 1
  • 9
  • 18
12
votes
1 answer

How do the CloudKit security roles and permissions work?

There are three default security roles in CloudKit: World Authenticated Creator And three permissions: Create Read Write How do these security roles and permissions work? Here are examples of some of the questions I would hope get answered by…
Senseful
  • 86,719
  • 67
  • 308
  • 465
12
votes
6 answers

CloudKit: Fetch all records with a certain record type?

I have currently got CloudKit set up in my app so that I am adding a new record using the help of the following code below, CKRecordID *recordID = [[CKRecordID alloc] initWithRecordName:@"stringArray"]; CKRecord *record = [[CKRecord alloc]…
user2284295
11
votes
2 answers

iOS15: NSPersistentCloudKitContainer: how to un-share objects?

I’m working on an app that uses the new sharing support in iOS 15 using NSPersistentCloudKitContainer. I do not see a way to tell Core Data that an object, or set of objects, is no longer shared. For example, if I create a set of objects and then…
coping
  • 805
  • 1
  • 8
  • 19
11
votes
1 answer

Core data + CloudKit - sharing between iOS and watchOS companion app

In my app I store data with core data. Recently I discovered the new feature introduced by Apple in WWDC19 which allows core data to work with CloudKit. I just enabled cloudKit for my app and used an NSPersistentCloudKitContainer instead of…
Cydiaddict
  • 277
  • 4
  • 17
11
votes
3 answers

CKError: Query filter exceeds the limit of values: 250 for container

I want to pull down around 500 "Visit" records from the public database. CloudKit only gives you 100 records at a time so I just utilize the CKQueryCursor like below to get all the records I want. func fetchVisits(_ cursor: CKQueryCursor? = nil) { …
William T.
  • 12,831
  • 4
  • 56
  • 53
11
votes
1 answer

Trouble Replacing CloudKit Records

I get the fatal error: "Could not cast value of type 'NSTaggedPointerString' to 'NSData'" on the line "if (NSKeyedUnarchiver.unarchiveObject(with: loadedData as! Data) as? CKRecord) != nil". There is another fatal error:"Attempt to set a…
Steve
  • 1,121
  • 1
  • 12
  • 32
11
votes
2 answers

Fetching CKAsset Image From CloudKit is Very Slow

I am using CloudKit as a server backend for my iOS application. I'm using it to house some relatively static data along with a handful of images(CKAsset). I ran into a problem when the time came for me to actually fetch those assets from the public…
BlueBear
  • 7,469
  • 6
  • 32
  • 47
11
votes
5 answers

Obtaining CKAsset URL without downloading data

I'm using CloudKit in my app as a way to persist data remotely. One of my records has an CKAsset property that holds an image. When I'm fetching the records, I realized that it's taking so much time to finish the query. After multiple testings, I…
HusseinB
  • 1,321
  • 1
  • 17
  • 41