Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Style of NSUserNotification

A NSUserNotification only shows the action button if the user sets the style of the notifications for my app to "alerts" in the system preferences. Can I somehow set this style for my application as a default instead of relying on the user to manually select it?

like image 683
tobiasbayer Avatar asked Aug 06 '12 15:08

tobiasbayer


1 Answers

It took me a while to track down how to accomplish this in my own app.
According to Apple's info.plist keys reference:

NSUserNotificationAlertStyle Specifies whether the notification style should be banners, alerts, or none. The default value is banners, which is the recommended style.

In your case you need to define the key NSUserNotificationAlertStyle in info.plist with the value alert.

like image 71
kurthardin.dev Avatar answered Oct 07 '22 12:10

kurthardin.dev