I am working on sample user notification on 10.8 however the key NSUserNotificationAlertStyle when i set it to alerts not working, my application still shows it as banner, the only way to control it through the system preference but what if i want to set the default behaviour to be alert style??
相关问题
- Xcode debugger displays incorrect values for varia
- Is there a way to report errors in Apple documenta
- Advice for supporting both Mac and Windows Desktop
- Remove keyboard notification when ViewController d
- Avoid cmake to add the flags -search_paths_first a
相关文章
- 现在使用swift开发ios应用好还是swift?
- Visual Studio Code, MAC OS X, OmniSharp server is
- xcode 4 garbage collection removed?
- IntelliJ IDEA can't open projects or add SDK o
- Automator: How do I use the Choose from List actio
- ImportError: No module named twisted.persisted.sty
- How can I vertically align my status bar item text
- git command-line on Mac OS error “dyld: Symbol not
You don't need to sign your code, but the end user can change your notification type from System Preferences --> notifications (and then he can choose, None/Banner or Alert). See also this post: Add Alert vs Notification flag
After go through every topics about this issue, I think there might be not very clear in each part, so I try to list all the steps for the developer who might also have this problem. To have the alert notification work, you can follow with Lexandr's sign steps 1,2,3, then you will get it work.
But if you are in the developing phase, or just have a debug, you still want to see what it looks like in the notification center. You need to open system preference->notifications, find your debug app, and choose the alert style to alerts. Then you can continue to develop without waiting for the sign to see the final result.
According to these two bug reports, the key
NSUserNotificationAlertStyle
isn't working for anyone at the moment.http://openradar.appspot.com/12632111
http://openradar.appspot.com/12632157
It works, but you must
alert
string value forNSUserNotificationAlertStyle
key in your app info.plist file;Notifications
tab ofSystem Preferences
.If you already experiment with notifications it will be better to perform it from scratch. Here how you can remove app from User Notification Center.