cloudkit

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

蓝咒 提交于 2019-11-30 08:15:57
问题 I have submitted an iOS app that uses CloudKit to Apple. It's being rejected because it requires user to sign into iCloud for access. Apple's reasoning is that even without iCloud sign-in, the public database is still readable. So that part of the app should function. I am trying to modify the app but I continue to get this error when I am not signed in. <CKError 0x8141a360: "Internal Error" (1/4000); "Couldn't send a valid signature"> I have searched the web and the solution is always just

How do I delete a CloudKit container?

我与影子孤独终老i 提交于 2019-11-30 04:41:09
I accidentally created a new container in CloudKit, and it is really annoying that it comes up when I open dashboard. Any suggestion how to delete? On developer.apple.com I don't see a delete button for containers. Ezimet Apple's iOS CloudKit documentation: Enable iCloud and Select CloudKit Important: When you select CloudKit, Xcode creates a default container ID based on the bundle ID. Because you can’t delete iCloud containers , verify that your bundle ID is correct in the General pane in Xcode before selecting CloudKit. To change your bundle ID, read Set the Bundle ID in App Distribution

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

廉价感情. 提交于 2019-11-30 03:51:27
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 covered in the previous question), what does this information help me guard against? (data corruption I assume) encodeSystemFields is useful to avoid having to fetch a CKRecord from CloudKit again to update it (barring record conflicts). The idea is: When you are storing the data for a record retrieved from CloudKit (for example, retrieved via

CloudKit - no server-side logic?

旧街凉风 提交于 2019-11-30 03:39:32
With CloudKit , you can focus on your client-side app development and let iCloud eliminate the need to write server-side application logic . CloudKit provides you with Authentication, private and public database, structured and asset storage services — all for free with very high limits. You cannot upload any code to run on Apple's servers? I've heard it being compared to Google App Engine and other cloud computing platforms, but without the ability to run your own code, isn't the whole thing pretty limited and not really comparable? For example, if I want to build a news app which

How to sync records between Core Data and CloudKit efficiently

本小妞迷上赌 提交于 2019-11-30 00:04:32
I'm currently learning how to use CloudKit Framework and lack of documentation or examples showing how to sync Core Data and CloudKit. I have watched all WWDC videos (2014, 2015, 2016) Dedicated to CloudKit, but none of them telling us how to implement syncing with Core Data. I can't find any fresh examples, tutorial or books, showing how to implement this syncing. I know that it is effective to use Operations API by CloudKit (not Convenience API) and to Subscribe to changes as it said in the new WWDC 2016 videos, dedicated to CloudKit, but mapping with CoreData is a real problem. For example,

Use production CloudKit during development?

谁说胖子不能爱 提交于 2019-11-29 19:46:53
My iOS and Mac apps have been launched to the App Store and all of my users, including myself, are using the CloudKit production database. My question is, is there any way to target the production environment for my development builds? It seems there is no way to target the production environment outside of the Mac App Store, and for iOS, only Ad Hoc distribution can target the production environment. RawMean Add the following entry to your entitlements file and perform a clean build. This allows you to run your application in Xcode with the cloudKit in the production mode. Entry to add: com

How to query by creationDate in CloudKit?

最后都变了- 提交于 2019-11-29 18:13:53
问题 I want to fetch the last X minutes of public/private entries from CloudKit. I tried something in this effect but failed: let date = NSDate(timeInterval: -60.0 * 120, sinceDate: NSDate()) let predicate = NSPredicate(format: "creationDate > %@", date) But this will get me data, but I'm not sure if I'm querying everything or just to some kind of cap: let predicate = NSPredicate(value: true) I want to be able to query by certain amount of time. Is this possible without doing the creation sorting

CloudKit Batch Fetches?

走远了吗. 提交于 2019-11-29 16:11:14
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. Edwin Vermeer The number of records returned by CloudKit is not fixed. CloudKit has a mechanism for deciding how many records to return. It looks like it's currently 100, but it could change depending on the current load on Cloudkit. It is possible to set this to a fixed number on the CKQueryOperation object. The default is: operation.resultsLimit = CKQueryOperationMaximumResults; The documentations for this property says: When

Observe CKRecord deletion via CKSubscription does not work

孤街浪徒 提交于 2019-11-29 14:07:02
问题 CKSubscription doc says: When a record modification causes a subscription to fire, the server sends push notifications to all devices with that subscription except for the one that made the original change to the record. Let assume I have two devices: device 1 and device 2 logged in from different iCloud accounts. Let assume both devices subscribed for record deletion for a certain record type. If device 1 creates a record and then device 1 deletes it then device 2 get notified - THAT IS

How to properly send an image to CloudKit as CKAsset?

蓝咒 提交于 2019-11-29 10:47:42
I have an image (UIImage and it's url too) and I'm trying to send it to CloudKit as a CKAsset but I'm having this error: Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: 'Non-file URL' . Here is the code: override func viewDidLoad() { super.viewDidLoad() send2Cloud() } func send2Cloud() { let newUser = CKRecord(recordType: "User") let url = NSURL(string: self.photoURL) let asset = CKAsset(fileURL: url!) newUser["name"] = self.name newUser["photo"] = asset let publicData = CKContainer.defaultContainer().publicCloudDatabase publicData.saveRecord(newUser,