registerForRemoteNotifications not working at all in Big Sur?

I am working on a macOS app that involves remote notifications. In my app delegate appDidFinishLaunching, I simply call

Code Block
NSApplication.shared.registerForRemoteNotifications()


I then get one of two callbacks in the app delegate, either didRegisterForRemoteNotificationsWithDeviceToken or didFailToRegisterForRemoteNotificationsWithError. This has worked fine forever in previous versions.

In Big Sur, this does not seem to work at all. I call the registerForRemoteNotifications, but I never get either callback called.

My hypothesis was that this is because of the new app lifecycle (which is where I originally tried this out). I built a small test app with AppKit app delegate lifecycle. It is equally broken there.

What gives? Why cannot I register for remote notifications in Big Sur?

Accepted Reply

Same here as recent posters. Finally fixed in Big Sur 11.4, works again in both production and developer environments.

Replies

I have the same problem. Big Sure 11.1, xCode 12.4
I registerRemoteNotification but
didRegisterForRemoteNotificationsWithDeviceToken or didFailToRegisterForRemoteNotificationsWithError this not called.
I am running into the same problem.

After a big of digging I and enabling logging with private values I see the message from apsd

Code Block
<APSCourier: 0x7f895081edd0>: Token for 501 not connected, skipping request to generate token for topic "io.bartelmess.PushTest" and identifier ""


I assume that 501 is my user ID here. I am not sure what "not connected" means in this case.

It does not work for production and the development environment.
In a production environment with a notarized app it does not work.
It still the same on Big Sur 11.3.1.
I am just wondering, could it be that we are supposed to switch to something else and not use this any more?
And if it's not working in production now - what are we going to tell our customers?
After upgrading to macOS Big Sur 11.4 Beta, my app finally got the call of "didRegisterForRemoteNotificationsWithDeviceToken". I hope this is fixed.
Praise be (to Darwin and Turing and Ada Lovelace and whoever fixed this)
Big Sur 11.4 - it works!!

Same here as recent posters. Finally fixed in Big Sur 11.4, works again in both production and developer environments.