cloudkit

How to keep updating cloud kit record in swift?

三世轮回 提交于 2019-12-23 07:05:26
问题 My app needs to update users current location to cloud server So how to update users current location to cloud server? I tried to use saveRecord but it doesn't work and error occurred error:Optional(<CKError 0x17005eea0: "Server Record Changed" (14/2037); "Error saving record <CKRecordID: 0x1458bb9c0; FASVSE10761FDM:(_defaultZone:__defaultOwner__)> to server: Protection data didn't match">) Thanks :) 回答1: You first have to fetch the record, then change it and save it back. If you get the same

“Couldn't send a valid signature” error when using CloudKit

♀尐吖头ヾ 提交于 2019-12-23 06:54:59
问题 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 = %@

“Couldn't send a valid signature” error when using CloudKit

我怕爱的太早我们不能终老 提交于 2019-12-23 06:54:07
问题 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 = %@

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

夙愿已清 提交于 2019-12-23 02:28:25
问题 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 =

Saving an Asset List (array) to specific CKRecord

本秂侑毒 提交于 2019-12-22 17:04:08
问题 I've a CKRecord type created in the CloudKit backend with some properties related to that class. I've String properties, Bytes and I have a Asset List property, so store some images (multiple images related to a single record). Now I'm trying so store some images and then fill the property and then trying to save it to CloudKit, but it's not working. Code goes as it follows: var images_array = [CKAsset]() // append the an image to the array images_array.append(CKAsset(fileURL: writeImage

CloudKit - “Invalid bundle ID for container”

心已入冬 提交于 2019-12-22 13:59:22
问题 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[

CloudKit: switch container environment from Development to Production

佐手、 提交于 2019-12-22 10:45:37
问题 I'm building a test tool to verify content in CloudKit, but I want to be able to select the container's environment. On iOS, you can select either the "Development" or the "Production" environment when you export your app for ad hoc testing, but you don't have that option on OS X. It always points to the "Development" environment. Anyone knows, if there is a programmatically way to set or select what container environment you want to work with, either on OS X or iOS? 回答1: In the entitlements

CloudKit for sending push notifications through cron jobs?

試著忘記壹切 提交于 2019-12-22 08:35:38
问题 I'm creating a college dining menu app, in which I need to send push notifications based on the daily menus. Originally, I was planning on storing user data in a database through Heroku and using cron jobs to compare the data in the database with the daily menus and send appropriate notifications to users. After the news on Cloudkit, however, I thought I could use that instead to manage the server-related part of my code. After closer inspection, though, it seems like Cloudkit is currently

Not sure how to generate an ECDSA signature, given a private key and a message

ぃ、小莉子 提交于 2019-12-22 07:36:37
问题 I'm following Apple's guide towards composing a CloudKit Web Services request. The bit I'm having trouble with is Step 2, under "Authenticate Web Service Requests": Compute the ECDSA signature of this message with your private key. Before getting to this point, I generated my certificate, a .pem file, which when opening it in a text editor shows me my private key, so I have that in string format too. I've also followed the steps for generating what it refers to as a message, which I now have

How to store big image in CloudKit?

て烟熏妆下的殇ゞ 提交于 2019-12-22 07:00:57
问题 I tried to upload a picture to CloudKit , and store it as NSData , but with a relatively bigger picture, taken with camera, I get this error: Error saving record <CKRecordID: 0x15998770; 04359DFA-8370-4000-9F53-5694FC53FA9C:(_defaultZone:__defaultOwner__)> to server: record too large id=04359DFA-8370-4000-9F53-5694FC53FA9C of type UserSetting What is the maximum size of data is able to store in CloudKit ? How do you store big images taken with camera in CloudKit ? I tried with two image, and