What's new in CloudKit

RSS for tag

Discuss the WWDC21 session What's new in CloudKit.

View Session

Posts under wwdc21-10086 tag

10 results found
Sort by:
Post not yet marked as solved
992 Views

NSPersistentCloudKitContainer with public database doesn't work and is poorly documented

So I tried the public database feature of NSPersistentCloudKitContainer last year but never really got anywhere so I thought i'd try it again this year. However I've still had basically no luck and I figured now might be a good time to try and document the issues I have had. The documentation for this at https://developer.apple.com/documentation/coredata/mirroring_a_core_data_store_with_cloudkit/creating_a_core_data_model_for_cloudkit mentions shouldInitializeSchema which from what I can gather was removed in a beta version a long ** time ago. It appears to now be a method on the container - container.initializeCloudKitSchema(). Ya'll should update this documentation. initializeCloudKitSchema does not work if you have options.databaseScope = .public on the NSPersistentCloudKitContainerOptions. You get a bunch of errors saying "No authToken received for asset" Turning off the public scope and then calling initializeCloudKitSchema gets you the Record types you need created in the CloudKit console, then removing the initialise code and setting it back to public, it APPEARS to work, but then... The WWDC video from 2020 says that before you can sync you need to add two indexes to each record type recordName and modifiedAt however if you get this far you will have no such fields. After running it a few times and scouring through the logs you will spot a few errors telling you about missing indexes - adding querable index to recordID, and queryable + searchable to modTime gets you something that.... appears to work... kind of. Ok so you get this far, and you insert some object into your store and save them - and they appear on the cloudkit server, huzzah!. Then you delete the app and reinstall it, and the objects appear in your app, huzzah! However you will now start getting a ton of these kinds of errors in your log: com.apple.coredata.cloudkit.zone:__defaultOwner__ = <CKError 0x2814192f0: "Server Rejected Request" (15/2027); server message = "Custom zones are not allowed in public DB"; op = 8F0FD95A1EFB2348; uuid = F1DCD158-BA28-4E20-AD18-723F603A0C00> And if you use your app to add or edit any objects they won't make it to CloudKit any more. However, adding new objects via the console will make them appear in the app. At this point I kinda gave up. Can somebody tell me I am an *****, or does this feature legitimately not work?
Asked
by tomwilson.
Last updated
.
Post marked as solved
377 Views

CloudKit Console: Field 'recordName' is not marked queryable

[Newbie Question]. I am not sure how to find the index (that should be a Metadata) so that I can mark it as queryable. Does anyone have any suggestions for me? Screenshots of my error and the Metadata available. Thanks in advance!
Asked
by mbain108.
Last updated
.
Post not yet marked as solved
320 Views

CloudKit Web Services access to encrypted values

The WWDC 2021 CloudKit session talked about the new encryptedValues field on CKRecord. It also indicated that CKAssets have already been end-to-end encrypted in previous releases. The documentation indicates that for encrypted values such as these: CloudKit encrypts the fields’ values on-device before saving them to iCloud, and decrypts the values only after fetching them from the server. The encryption keys are available exclusively to the record’s owner and, if the user shares the record, that share’s participants. For a client that is accessing CloudKit via the HTTP interface, the documentation indicates that assets have a downloadURL property which can be used to fetch the asset. Does this URL download the already-decrypted asset? Or does it need to be encrypted after downloading? If the asset is already decrypted at the time it is downloaded, how can this work, since as I understand it the key should not even be available to Apple. If the asset is not decrypted at that point, is there documentation about how we need to decrypt it?
Asked
by bjhomer.
Last updated
.
Post not yet marked as solved
121 Views

Will CloudKit’s encrypted fields work with CloudKit JS?

Does the new encrypted fields work with CloudKit JS? I have checked the API for CloudKit JS, and under CloudKit.Record there is no mentioning of encrypted fields. It feels like this API has not been updated for a while. Does this mean that if I use field-level encryption, I will not be able to use CloudKit JS?
Asked
by selveskii.
Last updated
.
Post not yet marked as solved
212 Views

New CloudKit APIs

Hi. I have heard that the CloudKit APIs should be ready for the new async and await pattern. In the demo app, I see completion handlers and completion blocks. Also, I have an app that needs to use the share DB and it is quite confusing and messy how different caches are handled. I was hoping for a more straightforward API. Is any chance that we can see an updated demo of how to use the shared database in a list?
Asked Last updated
.
Post not yet marked as solved
273 Views

Server Rejected Request: Custom zones are not allowed in public DB

Perhaps I misunderstood, but I believe I was told that I would have the ability to migrate existing code, which currently uses a public database from using a naive fetch with a date check, to using change tokens. However, after launching the sample app on a public database, it appears that it's still not possible to create custom zones in a public database, which is required for change tokens and notifications. Did I misunderstand the conversation, or is there a secret way to do this now? Any help is much appreciated. If it's not possible, is it worth filing a feedback request for this feature?
Asked Last updated
.
Post marked as solved
240 Views

CloudKit public database access changes?

With the new CloudKit advancements from WWDC21 does the user still need to be signed into an iCloud account to write to the public database?
Asked
by eth021021.
Last updated
.
Post not yet marked as solved
263 Views

Where can I find the limits and costs of CloudKit?

There used to exist a CloudKit data limits and costs calculator, but I'm having trouble locating it. Specifically, I'm interested in the public database storage provided at the free tier and also what the overage fees look like.
Asked
by aalittle.
Last updated
.
Post not yet marked as solved
252 Views

CloudKit Dashboard not showing any error data since recent UI change

Since WWDC 21 UI change the cloudKit dashboard, I am now unable to see any error count for my App. These errors like Quota_exceed, Zone_not_found are quite steady for my App so I think there might be a problem with the update.
Asked
by jakehao.
Last updated
.
Post not yet marked as solved
233 Views

Data compression on CKRecord encrypted fields

When I use a NSData field, should I compress data before setting value or is it done by encryption? If data is encrypted first, compression after that is generally more complicated. Or perhaps compression gain is not really significant and I don't need to care about it?
Asked Last updated
.