My NSUserNotification
is being delivered, playing the given sound, but doesn't show visually on the screen if my app is not the top-most application.
If my application is in the background, the notification does not show. If my application is active, it shows. In both cases the sound plays.
Here is how I'm sending the notification:
NSUserNotification *notification = [[NSUserNotification alloc] init];
[notification setTitle: @"hi"];
[notification setSoundName: NSUserNotificationDefaultSoundName];
[notification setDeliveryDate: [NSDate dateWithTimeIntervalSinceNow: 3]];
[[NSUserNotificationCenter defaultUserNotificationCenter] scheduleNotification: notification];
And I am overriding shouldPresentNotification
to always present it.
[NSUserNotificationCenter defaultUserNotificationCenter].delegate = self;
...
- (BOOL)userNotificationCenter:(NSUserNotificationCenter *)center shouldPresentNotification:(NSUserNotification *)notification {
return YES;
}
OSX 10.10.1 Yosemite
How do I make this notification always display, just like it always plays the sound?