2

I have a macOS app which uses CloudKit. I'm trying to deliver remote notifications for database record changes, but I didn't get any notifications through.

I've set everything correctly and according to Apple guides. I then tried sending push notifications manually from the console to see if there were issues in the APNS delivery itself.

The notifications didn't get sent, even though I had the correct token. In the log, I can see that my notification was received by server, but then discarded as device was offline.

However, if I reset apsd on my device (sudo killall apsd) the latest notifications do come through immediately. They seem to get clogged up endlessly, unless the service is restarted.

I'm unsure if this is a setup issue on my end or a bug in macOS (Sequoia). I don't have more Mac computers to test it out, but the issue seems to persist no matter my iCloud account or macOS user.

After that, the steps in Push Notification Console say:

  • received by APNS server
  • stored for device power considerations (100 ms later)
  • sucessfully delivered to the target device (20 sec later, the moment apsd was restarted)

Possible Reason

The clearest culprit is that, if I build a new project with no iCloud capability, the notifications seem to work. Once I've added iCloud (with no services checked) the issues begin, and never go away after that.

How could I debug the issue further, and how to rule out either a system malfunction OR plain user error?

2
  • 1
    I have an app that runs on iOS and macOS. It uses CloudKit to sync data between devices. Changes made on the Mac appear on an iPhone almost instantly. Changes made on an iPhone take many minutes to appear on the Mac. Been this way since I added support back in macOS 12. I’ve never understood why the CloudKit notifications take so long to get handled on the Mac. Commented Aug 14 at 15:51
  • 1
    I also did some investigation, and the notifications are very random. It could take even an hour for a notification to reach the macOS app in my latest test. The strangest part is still that restarting apsd does deliver all of them instantly. Commented Aug 14 at 16:14

0

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.