Apple Push Notifications arriving on MacOS, but not in the application itself

I'm running an iOS one-time password (OTP) application, and a corresponding MacOS companion app. In the iOS application, users are able to tap on one-time passwords, resulting in the iOS application sending an HTTP request to my server. My server in turn, will send a push notification to the MacOS application, containing the tapped one-time password. All encrypted of course, but that's irrelevant for the issue.

  1. iOS application (user taps one-time password)
  2. HTTP request (iOS application sends HTTP request to my server)
  3. My server (my server sends HTTP request to APS)
  4. APS (APS sends notification to MacOS application)
  5. MacOS application (MacOS application puts one-time password on clipboard)

Recently, after users started upgrading to MacOS Ventura, the MacOS application stopped receiving notifications for some users. I can see (and I've verified) that the process from the iOS application to the server, to APS works. APS returns a 200 OK success status, indicating that the push notification was sent to the MacOS device.

However, in my MacOS application the notification is not received in the didReceiveRemoteNotification function (which I included below).

func application(_ application: NSApplication, didReceiveRemoteNotification userInfo: [String : Any]) {
    NotificationHelper.shared.notify(userInfo)
    
    log.verbose("Received a remote notification in the application delegate.")
}

The didRegisterForRemoteNotificationsWithDeviceToken function does work, and I can see it succeeded because of my applications' debug logging.

func application(_ application: NSApplication, didRegisterForRemoteNotificationsWithDeviceToken deviceToken: Data) {
    settingsView.pushToken.data = deviceToken
    linkingView.pushToken.data = deviceToken
    
    log.verbose("Successfully completed APNS registration process.")
}

I've verified that I'm using an actual production key for APS, and that the MacOS application itself is a production build as well (or well, TestFlight in my case). I used the same production key and build before users started upgrading to Ventura, and it always worked (and still works for some users).

What's interesting is that, although I can't see anything in Xcode or in my debug logging of the production build of the app, the Console.app of MacOS does show the push notification being received. I've included some of the Console.app APS logging (from when a notification should be received in my MacOS application) in the attachments.

There are two lines that caught my eye, and those of some other users of my app debugging the issue. These are also included in the attachments.

However, searching for these specific errors from the logging on the internet does not yield any (helpful) results. Therefore, I would like to ask you for help!

For users of my app where push notifications are working, I've also included an attachment of the logging.

Any ideas on why I'm not receiving these notifications correctly in my MacOS app are welcome. Hopefully we can get to a solution.


We are having the same issue. Same errors in the log. Did you ever figure out what was happening?

I am having this issue as well. Has been working for years (background notifications) but in last few months or so has stopped working. I am also getting the same errors in the Console.

Did not yet figure it out. I did use an Apple Technical Developer request af few days ago. They requested some specific logging which I sent them yesterday. I'll keep you posted.

Apple Push Notifications arriving on MacOS, but not in the application itself
 
 
Q