CloudKit Notifications With Mac Catalyst

Sync between iOS and Mac Catalyst is intermitent. The fundamental issue is slow and inconsistent remote notifications being sent to and received by the Mac Catalyst app.


When making changes in the Mac Catalyst app, those changes are successfully pushed to the iCloud private database and the iOS or iPadOS app successfully receives the remote notification indicating the change. In short, the MacOS -> iOS direction is seemless.


When making changes in the other direction, we run into problems. A change in the iOS app successfully gets pushed up to the iCloud private database, and other iOS or iPadOS devices successfully receive the remote notification. However, Mac Catalyst apps most commonly will not receive the remote notification at all, or – occassionally – will receive it several minutes after the change took place. Rarely will the Mac Catalyst app receive the notification in a timeframe consistent with the performance of iOS apps (within 2-4 seconds).


Why are Mac Catalyst apps having so much trouble receiving these CloudKit-triggered remote notifications?


(Note that these issues are present in both development and production environments.)

Replies

Same problem here. App syncs, but sooooo late.
I guess this is still an issue. Mac change triggers notification on iPad, but not the other way around. Did anyone ever figure this out?

years later, I have hit this issue with macOS Monterey beta 1, even restarting the Mac app it doesn't look to be pulling in the changes, but any changes made are pushed to the iOS side fairly quickly.

This is all though the development environment in cloudkit, and running the Mac app via Xcode, so maybe production works better.

update: things randomly started working, so my particular issue may have been code related more so than push notifications.

Se this article https://stackoverflow.com/questions/64404246/xcode-how-to-reset-delete-a-mac-os-app-run-from-xcode-analog-to-deleting-th

I think I was able to solve a similar problem, though my problem was slightly different. The short answer is: use at least a .userInitiated qualityOfService in Catalyst; when the qualityOfService is .default (or below) requests become discretionary when the app is in the background (i.e., inactive). And I think that's where the problem is.

For a longer answer, see my response on Stack Overflow.