diff --git a/src/plugins/backends/osxnotificationcenter/osxnotificationcenter.mm b/src/plugins/backends/osxnotificationcenter/osxnotificationcenter.mm index c71d2fc..db2c89f 100644 --- a/src/plugins/backends/osxnotificationcenter/osxnotificationcenter.mm +++ b/src/plugins/backends/osxnotificationcenter/osxnotificationcenter.mm @@ -86,18 +86,24 @@ BOOL installNSBundleHook() ^{ int notificationId = [notification.userInfo[@"id"] intValue]; qDebug() << "!!! Notification was delivered to NotificationCenter. ID:" << notificationId; - BOOL notificationAvailable = YES; - while(notificationAvailable) { - notificationAvailable = NO; + qDebug() << "--- List available notifications in NotificationCenter:"; + for(NSUserNotification *osxNotification in [[NSUserNotificationCenter defaultUserNotificationCenter] deliveredNotifications]) { + int fetchedNotificationID = [osxNotification.userInfo[@"id"] intValue]; + qDebug() << "--- Notification is available with ID:" << fetchedNotificationID; + } + bool notificationAvailable = true; + while(notificationAvailable == true) { + notificationAvailable = false; for(NSUserNotification *osxNotification in [[NSUserNotificationCenter defaultUserNotificationCenter] deliveredNotifications]) { int fetchedNotificationID = [osxNotification.userInfo[@"id"] intValue]; if(fetchedNotificationID == notificationId) { - notificationAvailable = YES; + notificationAvailable = true; [NSThread sleepForTimeInterval:0.25f]; break; } } } + qDebug() << "Finishing availability checking for notificaion with ID:" <