Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Alert vs Notification flag #3

Open
edalquist opened this issue Dec 27, 2012 · 2 comments
Open

Add Alert vs Notification flag #3

edalquist opened this issue Dec 27, 2012 · 2 comments

Comments

@edalquist
Copy link

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.

@jamesstout
Copy link

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:

screen shot 2013-07-25 at 2 33 32 pm

@jamesstout
Copy link

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants