cloudkit

CloudKit CKQueryOperation doesn't get all records

自古美人都是妖i 提交于 2019-12-03 20:23:43
In CloudKit RecordType is more than 100 records. Following code gets from these only 11 and they are not first 11 records, they are picked randomly from beginning, center and at the end of records. I can't get whats wrong in code. EDIT : I got it working by changing .reseltsLimit to 5000! let cloudContainer = CKContainer.default() let publicDatabase = cloudContainer.publicCloudDatabase let predicate = NSPredicate(value: true) let query = CKQuery(recordType: "Sijainti", predicate: predicate) var queryOperation = CKQueryOperation(query: query) queryOperation.queuePriority = .veryHigh

CloudKit error handling - retry logic

旧街凉风 提交于 2019-12-03 20:21:52
I want to put excellent CloudKit error handling in my app as Apple wants us to do. I want to save and modify a record right now. Here is my basic save logic... func addNewRecord(managedObj: NSManagedObject) { let newRec = managedObj.convertToCkRecord() publicDB.saveRecord(newRec, completionHandler: saveHandler) } func saveHandler(savedRecord: CKRecord?, error: NSError?) { // handle errors here if let error = error { if error.code == CKErrorCode.NotAuthenticated.rawValue { // debug print("Not authentricated") } else if error.code == CKErrorCode.NetworkFailure.rawValue { print("Network failure!!

CloudKit: CKFetchRecordChangesOperation, CKServerChangeToken and Delta Download

安稳与你 提交于 2019-12-03 16:36:32
My question is related to the "Delta Download" thing as it was named in WWDC 2014 Advanced CloudKit. I'm trying to make syncronization for my Core Data app, which is iPhone only for now (think: there is only one device active). So, basically the app will store user records in the cloud from one same device, for the most cases for now. I have trouble with understanding custom zone feature which is based on CKFetchRecordChangesOperation aka Delta Download. As I got it right, we have CKServerChangeToken 's to maintain sync operations (I mean download only those records which was added/modified

CKAsset won't show in tableview image

大城市里の小女人 提交于 2019-12-03 16:29:49
I have an optional image in the cloudkit DB(checked DB and the image is there in cases where I added it in my testing). I have created a class that initializes the record fields into variables I use in my tableview. I have a custom cell as well. But the image won't display in my custom tableview cell. I don't know if having an optional image in a tableview image is causing a problem or if there's an issue with my code/settings in cloudkit. Any help is greatly appreciated, as I've been stuck for over a week and there's little to nothing online about this. Here's my class code: var feedResults =

Anonymously Log In to an App with iCloud Apple ID

萝らか妹 提交于 2019-12-03 14:15:10
问题 According to this CloudKit overview: CloudKit also enables your users to anonymously sign in to your apps with their iCloud Apple IDs without sharing their personal information. I can't find anything else in their documentation about this capability. I already have an app with my own backend, so I wouldn't need any of the back-end-as-a-service features that CloudKit offers, but I would like to take advantage of logging a user in with their iCloud account, much the same way we currently do

iCloud and Xcode 6 - Ubiquity Container

早过忘川 提交于 2019-12-03 14:14:13
I am currently working on an app for iOS 8 which uses iCloud Drive and the CloudKit Framework. Everything was set up by using Xcode 6. When I try to submit my App to iTunesConnect I get the following error: When I'm adding the Key in my iCloud entitlements I'm not able to Code sign the app and Xcode sends me an error,too. <key>com.apple.developer.ubiquity-container-identifiers</key> <string>de.sn0wfreeze.CloudFInder</string> I'll get that error: And I'm not able to Code sign. Can anyone please help my with that issue ? Chris Prince I ran into the same situation. After stumbling around for a

CKContainer.discoverAllIdentities always fails

不羁岁月 提交于 2019-12-03 12:27:14
The CKContainer.discoverAllIdentities request always fails in my CloudKit app. It has continually failed over the course of several days. A simplified version of the code that is failing (which results in the same error) is: private func getContacts(completion: (([CKUserIdentity]?) -> Void)?) { container.status(forApplicationPermission: .userDiscoverability) { [weak self] status, error in if let error = error { print(error) } switch status { case .granted: self?.discover(completion: completion) default: print("status not granted") } } } private func discover(completion: (([CKUserIdentity]?) ->

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

喜你入骨 提交于 2019-12-03 12:00:27
问题 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 let share = CKShare(rootRecord: record) share[CKShareTitleKey] = "title" as CKRecordValue share[CKShareTypeKey] = "pl.blueworld.fieldservice" as CKRecordValue share.publicPermission = .readWrite let modifyOperation = CKModifyRecordsOperation(recordsToSave: [record, share]

How do the CloudKit security roles and permissions work?

不问归期 提交于 2019-12-03 11:53:40
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 an explanation of security roles: What do the three roles mean? The first two seem obvious, but the last one seems less so. E.g. does Creator refer to the creator of the table, or the creator of a record? Where would the deletion permission fall under? Write? Can security roles be applied to individual records? (E.g. I want a user to have access to only a

Deleted CloudKit records Reappear

与世无争的帅哥 提交于 2019-12-03 11:04:41
I'm building an iOS application using CloudKit. It should allow a user to add, edit and delete Products in the cloud. The user can organize these in Folders. These folders are just other Record Types in cloudkit. There is no limit to the levels of folder the user can use, as any folder can just hold a CKReference to it's parent Folder. All CloudKit communication in my app happens in a dedicated CloudKitController Class This all works, but stops working after a while for no clear reason. When I test my app, I don't even user folders that are multiple levels deep. However, after using it a while