NSUserNotificationAlertStyle plist key not working

情到浓时终转凉″ 提交于 2019-12-01 04:52:50

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

Lexandr

It works, but you must

  1. Code sign your application;
  2. Set alert string value for NSUserNotificationAlertStyle key in your app info.plist file;
  3. Make sure they are not turned off in Notifications tab of System 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.

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.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!