Can an app use both alerts and banners in Notification Center?
Asked Answered
C

2

13

I am creating a Mac OS X application to use Notification Center. Some notifications should remain on the screen until the user interacts with them, and others should disappear shortly after displaying.

The NSUserNotificationAlertStyle key and changing System Preferences allow changing between banners and alerts. However, both approaches change all the notifications sent from my application.

Can I send some notifications as alerts and others as banners? If so, how?

Chauvinism answered 7/9, 2012 at 14:26 Comment(0)
D
8

NSUSerNotificationAlertStyle is the only way the developer can set the default notification style for the application, and it sets the style for all notifications from that app.

If you think it's really important for you to have 2 different kinds of notifications you can work around the problem by having a hidden helper application with a different NSUserNotificationAlertStyle than the main app.

Remember though you set the default notification style, but the user can change it whenever he wants in the notification center prefs, making your helper app useless.

Delossantos answered 8/9, 2012 at 9:24 Comment(0)
E
1

No. The different notification types exist so that the user may select what he/she prefers, not so that the developer can.

If you feel your app should have this ability, you should file an enhancement request at http://bugreporter.apple.com and let Apple know.

Ea answered 7/9, 2012 at 14:31 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.