#cloudkit — Public Fediverse posts
Live and recent posts from across the Fediverse tagged #cloudkit, aggregated by home.social.
-
Fun With SwiftData and CloudKit!: https://pmcconnell.micro.blog/2026/04/30/fun-with-swiftdata-and-cloudkit.html
-
RE: https://mastodon.social/@lukaskubanek/116317203336604688
Delivery of CloudKit notifications looks broken in iOS 26.4
One of the core technologies and services of the platform does not work
And the best guidance Apple has to offer to developers is “file a FB and maybe we take a look. Make sure you generate lots of duplicate FBs because otherwise we will not take it seriously”
Okay then
-
CloudKit and APNS is the bane of my existence
I create a visible subscription for inserted CKRecords that should just work
The records are fine and arrive with a fetch
But simply no push in development environment is sent for them
Are there any known issues for CloudKit push notifications in development environment, or any recent known good debugging and inspection methods for what is really going on? I wish I had delivery log on server side, but no such thing.
-
#iosdev #buildInPublic #coredata #cloudKit
Enough for tonight. Tomorrow I'll start prototyping the migration from explicitly ordered many:many to implicitly ordered via intermediate attributed relationship objects.
13/n
-
#iosdev #buildInPublic #coredata #cloudKit I also have make sure I'm selecting the Private database and the com.apple.coredata.cloudkit'recordName' is not marked queryable
https://lyons.app/2021/07/05/how-to-fix-field-recordname-is-not-marked-queryable-in-cloudkit/
gave me the answer: I have to modify the schema by adding a queryable index called recordName to the recordName metadata field for each record type so I can view the records. I also have make sure I'm selecting the Private database and the com.apple.coredata.cloudkit zone.
12/n
Edit: to fix link -
#iosdev #buildInPublic #coredata #cloudKit
Got the demo working after some annoying debug sessions. Seems like it has not been revisited since 2022, and iOS 18 changed the behaviour of collectionView.dequeueReusableCell - as of iOS 18 it asserts if you call it outside of cellForItemAt indexpath. it was being called in awakeFromNib to set a font.
You would think that a company with the resources of Apple would at a minimum task interns to COMPILE AND RUN demos called out in the docs 11/n
-
#iosdev #buildInPublic #coredata #cloudKit
There is some Apple demo code from WWDC 2022 that gives an example of deduplication on CloudKit sync. It's a simplified demo but it does give an example of a many:many (unordered) relationship. Let's see if we can get it running.
https://developer.apple.com/documentation/coredata/synchronizing-a-local-store-to-the-cloud10/n
-
And here is the blog post detailing the changes.
https://smork.info/blog/posts/beer-diary-version-2-4-released/
-
#indiedev #irishmusic #iosdev #buildInPublic #coredata #cloudKit
As an aside - I've learned a lot about CoreData and CloudKit from @fatbobman's blog.
-
#indiedev #irishmusic #iosdev #buildInPublic #coredata #cloudKit
Apple has improved their migration support since I last looked - migrating to the data model outlined above would work as a staged migration:
- add the new entities and any attributes needed to define ordering or deduplication
- populate the intermediate attributed relationships
- delete the old entitieshttps://developer.apple.com/documentation/coredata/staged-migrations
Now we can safely move from NSPersistentContainer to a NSPersistentCloudKitContainer
8/n -
#indiedev #irishmusic #iosdev #buildInPublic #coredata #cloudKit
Now we've sketched out a workable data model that works in both coreData and CloudKit, we need to work out:
- how to migrate from the existing model to the new one without losing data.
- how to handle merging databases from different devices given that the user might have duplicate entries or collections with different members or different ordering7/n
-
#indiedev #irishmusic #iosdev #buildInPublic #coredata #cloudKit
diagrams of where we are so far…
6/n -
#indiedev #irishmusic #iosdev #buildInPublic #coredata #cloudKit
The second case is a little more complex. Collections can contain Tunes and TuneSets. By default, they are time-ordered when users add to their contents. Users can also reorder them, and I've had requests (not yet implemented) for alphabetical and most-recent first ordering.
A superclass (Searchable) inherited by both TuneSet and Tune allows for containment of both in a Collection.5/n
-
#indiedev #irishmusic #iosdev #buildInPublic #coredata #cloudKit
Tune to TuneSet is a many:many relationship ordered by the tunes’ play order. Functionally, the user can add Tunes to TuneSets and re-order or remove them. We must convert the many:many relationship to an intermediate object with an ordering attribute that we can use when we retrieve a TuneSet. We will have to be able to manipulate the ordering attribute to let the user drag Tunes to re-order them in the UI.
4/n -
#indiedev #irishmusic #iosdev #buildInPublic #coredata
To zoom in a bit on the problem at hand: #cloudKit is the obvious choice for sync between devices. Apple's documentation would have you believe that all you need to do is change your NSPersistentContainer to a NSPersistentCloudKitContainer and all will be well!
Not so fast.
First of all, the coredata and cloudkit data models have to be compatible. In this case, we find the dreaded OrderedRelationship in two places.
3/n -
It feels great to shut down a server for enhanced privacy. Read the linked technical blog post for some thoughts and experience on CloudKit and notifications.
-
I had a great WWDC lab with some Apple CloudKit engineers to discuss some stuff I have encountered with @tact
CloudKit default notifications are sub-par, you can’t apply advanced rules for when (not) to deliver them
I thought I would need to use Notification Service Extension with a mute entitlement
The pattern that they suggested instead is to use silent notifications, and generate the visible notification locally
Apparently many Apple apps do that
Interesting 🤔
-
#APNS #Notifications #CloudKit
Just requested notificationn service filtering entitlement for @tact. I’m reworking how I’m doing notifications.
Since CloudKit does not have something like cloud functions to granularly configure whether a given notification gets delivered to a current user based on that user’s state (which it totally should do btw), I need to filter on the client side.
Has anyone else requested this entitlement? I wonder how long will it take?