macOS app: production APNs pushes arrive but apsd drops them – "completely unknown token" / "proxy client that is not connected" (sandbox works)

Environment

  • macOS 27.2.1 (26B131), MacBook Pro (Mac16,6), Xcode 27.2 (27B52)
  • Non-sandboxed SwiftUI menu-bar app (LSUIElement = YES), Developer ID signed, hardened runtime, notarized (spctl: "source=Notarized Developer ID"), installed in /Applications
  • Entitlement com.apple.developer.aps-environment = production, embedded Developer ID provisioning profile with Push Notifications (App ID has Push enabled)
  • Debug build: Apple Development signing, development profile, aps-environment = development

What works

  • Debug build: registerForRemoteNotifications() returns a token; a push sent directly to api.sandbox.push.apple.com (token-based auth, .p8, apns-push-type: alert, apns-topic = bundle ID) gets HTTP 200, the banner is shown and userNotificationCenter(_:didReceive:) is called.

What fails

  • Release build (notarized, /Applications): registerForRemoteNotifications() returns a production token (apsd logs copyTokenForDomain push.apple.com … PerAppToken.v0).
  • A direct push to api.push.apple.com with that exact token (same .p8 key, same headers) returns HTTP 200, the message reaches the Mac, but apsd drops it:

apsd: [com.apple.apsd:courier] isAppSpecificTokenValid push.apple.com <private> ,PerAppToken.v0 - using cache {count: 2}
apsd: [com.apple.apsd:courier] isAppSpecificTokenValid push.apple.com <private> ,ExtendedAppToken.v1 - using cache {count: 0}
apsd: [com.apple.apsd:courier] Received incoming push notification for topic: <private> but for a completely unknown token <private>
apsd: [com.apple.apsd:courier] <private> incoming message is for proxy client that is not connected. baseToken <private> destToken <private> publicTokens <private>
apsd: [com.apple.apsd:courier-oversized] Received message for enabled topic '<private>' … with priority 10

  • No banner is shown and the app's delegate is not called. The same happens with pushes sent through Firebase Cloud Messaging.

Already tried

  • Unnotarized vs notarized build; running from a build folder vs /Applications.
  • sudo killall apsd, then relaunching the app (same token returned, same result).
  • Verified the token received in application(_:didRegisterForRemoteNotificationsWithDeviceToken:) is exactly the one used in the request.
  • Once, during registration, apsd logged a fault: Couldn't write values for keys <private> in CFPrefsPlistSource (Domain: com.apple.apsd, User: kCFPreferencesCurrentUser …).

Question: what makes apsd treat a freshly issued production per-app token as "completely unknown" for a running, connected app, while the development environment works? Is there a known issue or a reset for apsd's production token state on macOS?