Custom icon for each NSUserNotification?
Asked Answered
A

4

6

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".

Aurangzeb answered 2/10, 2012 at 21:6 Comment(0)
I
1

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

Iorgos answered 2/10, 2012 at 21:8 Comment(0)
Y
8

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.

Yawl answered 25/1, 2014 at 22:16 Comment(0)
I
1

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

Iorgos answered 2/10, 2012 at 21:8 Comment(0)
C
1

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.

Callie answered 24/9, 2017 at 13:48 Comment(0)
U
0

Looking for a related answer about NSUserNotifications I found your question. Officially it's not yet supported. But I wrote a little custom control you can use that may fit your needs. Take a look on this Github repository.

Unaccountedfor answered 19/5, 2013 at 23:43 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.