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