DDMountainNotifier
DDMountainNotifier copied to clipboard
Add Alert vs Notification flag
Is it possible to add a flag to generate a persistent "alert" versus a transient notification? I believe the 10.8 API allows for alerts with a close/dismiss button that stay on the screen until user action.
You need to set the NSUserNotificationAlertStyle to alert in the app's Info.plist
<key>NSUserNotificationAlertStyle</key>
<string>alert</string>
Then
NSUserNotification *note = [NSUserNotification new];
note.hasActionButton = NO; // means the alert will just have a close button, not a show button
However, the user may override the alert setting to banners or none in System Prefs->Notifications:
From the OS X release notes:
The user has ultimate control over what notifications are displayed, and the style (banner, alert, etc). There is no mechanism to override the user preferences.