Tag: cloudkit

CKSubscription of type CKSubscriptionOptionsFiresOnRecordUpdate doesn't work

I setup a CKSubscription with the following code: NSPredicate *predicate = [NSPredicate predicateWithFormat:@”TRUEPREDICATE”]; CKSubscription *subscription = [[CKSubscription alloc] initWithRecordType:@”RecordTypeName” predicate:predicate subscriptionID:@”Subscription1″ options:CKSubscriptionOptionsFiresOnRecordCreation | CKSubscriptionOptionsFiresOnRecordUpdate]; CKDatabase *privateDatabase = [[CKContainer defaultContainer] privateCloudDatabase]; [privateDatabase saveSubscription:subscription completionHandler:^(CKSubscription * _Nullable subscription, NSError * _Nullable error) { if (error) { NSLog(@”Failed to subscribe.”); } }]; In application:didReceiveRemoteNotification: I get notified when […]

How to update progress with CKModifyRecordsOperation.perRecordProgressBlock

This is related to a recent thread Update progress with MRProgress. I converted my cloudkit queries from the convenience API to CKOperations as a result of previous thread (Thanks Edwin!). So while using CKModifyRecordsOperation to save a record, I can see the record’s progress via logging in the perRecordProgressBlock, which is great. However, I’m trying […]

“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: <CKError 0x7f8d5ba27a10: “Internal Error” (1/4000); “Couldn’t send a valid signature”> Here is my code snippet: CKContainer *container = [CKContainer defaultContainer]; CKDatabase *publicDatabase = [container publicCloudDatabase]; //CKDatabase *publicDatabase = [[CKContainer containerWithIdentifier:container] publicCloudDatabase]; NSPredicate *predicate = [NSPredicate predicateWithFormat:@”doctorName = %@”, @”Dr. […]

How to prompt for CKApplicationPermissionUserDiscoverability again

Is there a way to get iOS to prompt for CKApplicationPermissionUserDiscoverability again after the user has declined it? The most I’ve been able to do is remove permission in the iCloud settings pane in OS X, which just returns a deny to the iOS app without any user interaction. The app I’m writing is useless […]

How to modify CloudKit Reference Lists

I can modify the Reference List attribute of my CKRecord in the dashboard without problems, but how can I modify it programmatically? I currently try modifying it as a NSArray. It does not give me any sort of error but even though the array content is fine, the attribute does not get set. Also the […]

CloudKit Batch Fetches?

Using CloudKit, how can I fetch my results in batches? I know that the default fetch limit it 100 results. So who do I then fetch the subsequent 100 results? Thanks.

Is there any option to export all cloud kit data?

I am working on a application and I setup a development environment. Now I want to move to production environment. is There any option for moving all the data from development to production in cloud kit? or Can I export all the data in Json format?

SWIFT: I don't get notifications from my CloudKit app?

Here is my code: @IBAction func sendSweet(sender: AnyObject) { //delegate method let newSweet = CKRecord(recordType: “Extra1”) newSweet[“content”] = textField.text let publicData = CKContainer.defaultContainer().publicCloudDatabase publicData.saveRecord(newSweet, completionHandler: { (record:CKRecord?, error:NSError?) -> Void in if error == nil { dispatch_async(dispatch_get_main_queue(), { () -> Void in self.tableView.beginUpdates() self.sweets.insert(newSweet, atIndex: 0) let indexPath = NSIndexPath(forRow: 0, inSection: 0) self.tableView.insertRowsAtIndexPaths([indexPath], withRowAnimation: […]

How to retrieve AppleID of logged in user via CloudKit?

I figured out how to retrieve first / lastName of a logged in user. Is there a way to get the AppleID too?! var defaultContainer = CKContainer.defaultContainer() var publicDatabase = defaultContainer.publicCloudDatabase defaultContainer.discoverUserInfoWithUserRecordID(recordID, {userInfo, error in println(“firstName: \(userInfo.firstName?) lastName: \(userInfo.lastName?)”) })

CloudKit – “Invalid bundle ID for container”

I’ve just create a project in Xcode 9 beta 6 and add this code: let privateDB = CKContainer.default().privateCloudDatabase let greatID = CKRecordID(recordName: “GreatPlace”) let place = CKRecord(recordType: “Place”, recordID: greatID) privateDB.save(place) { (record, error) in if error != nil { let er = (error as! CKError).errorUserInfo print(“Error: \n”) print(“CKErrorDescription: \(er[“CKErrorDescription”]!)\n”) print(“ContainerID: \(er[“ContainerID”]!)\n”) print(“NSDebugDescription: \(er[“NSDebugDescription”]!)\n”) print(“NSUnderlyingError: […]