Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Custom icon for each NSUserNotification?

Is there any way to provide custom icons for each NSUserNotification, instead of the default app logo? Like the iconData parameter in Growl.

I want to show "Someone has just posted something" with the photo of this "someone".

like image 605
zavié Avatar asked Oct 02 '12 21:10

zavié


3 Answers

You still cannot change the (default) image showing your app's icon, but starting in OS X Mavericks you can in addition display an additional image using the new property contentImage, e.g. like this:

custom image in NSUserNotification

This new property isn't documented in the NSUserNotification class reference, but mentioned in the Foundation Release Notes for OS X 10.9.

like image 162
Tim Avatar answered Nov 08 '22 05:11

Tim


Currently not (Mountain Lion). You should post a feature request.

like image 34
DrummerB Avatar answered Nov 08 '22 04:11

DrummerB


I know this question has been dead for 5 years, but in case someone finds that question and is still looking for a solution, there is that one:

https://github.com/indragiek/NSUserNotificationPrivate

I've tested it in macOS Sierra and it still works. Just be warned, quoting the project creator:

This should go without saying, but using any of this will result in your app being rejected from the MAS (Mac Apple Store) and potentially breaking if the APIs change.

like image 1
VitorMM Avatar answered Nov 08 '22 04:11

VitorMM