OS X Notifications With Custom Images

Most interesting, the NSUserNotification class has gained a new ability in OS X 10.9 to display custom images.

This new function is not documented in the NSUserNotification class documentation, but only mentioned in the Foundation Release Notes for OS X 10.9 (and in the NSUserNotification header file, of course).

To display a custom image in a notification, use the new

@property (copy) NSImage *contentImage

NSUserNotification expects the image to have a 44×44 pixel resolution and will scale the image if it has another resolution. This looks like this:

Notification

or, in the Notification Center:

Notification Center