I had the same problem. Found a solution, just set AppDelegate on launch.
func applicationDidFinishLaunching(_ aNotification: Notification) {
NSApplication.shared.delegate = self
}
func applicationShouldHandleReopen(_ sender: NSApplication, hasVisibleWindows flag: Bool) -> Bool {
//Now is working
return true
}