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?
apsddoes deliver all of them instantly.