我的应用程序安排通知并很好地显示它
NSUserNotificationCenter.default.delegate = self
let notification = NSUserNotification()
notification.deliveryDate = Date(timeIntervalSinceNow: TimeInterval(10))
notification.title = title
notification.actionButtonTitle = "Do something"
notification.soundName = notificationSound != "none" ? notificationSound : nil
notification.otherButtonTitle = "Close"
NSUserNotificationCenter.default.scheduleNotification(notification)
当我按下按钮激活方法时叫好
func userNotificationCenter(_ center: NSUserNotificationCenter, didActivate notification: NSUserNotification) {
DDLogDebug("Did activate notification")
switch notification.activationType {
...
}
问题是打开的窗口在按下不需要的窗口后被激活。
应用程序是代理(UIElement),其中打开了多个窗口。尝试了非代理应用程序,问题仍然存在-它会激活主窗口
有什么想法吗?
很遗憾,我没有找到答案。我实现了自己的显示UIPanel的通知机制