OSX Notification Center Icon

11,159

Solution 1

You can force the Notification Center to refresh all of the icons by deleting the Notification Center database file (~/Library/Application Support/NotificationCenter/SOME_UUID.db) and then killing the Notification Center process (e.g., from Activity Monitor).

Unfortunately this has the side effect of deleting your notification history, but this wasn't too much of an issue for me.

Solution 2

I was able to fix this issue by incrementing the Build number in the General section for the build Target.

Solution 3

There's actually an ongoing debate on Apple's developer forums (link, link for people with access) about this. As far as I know, there's currently no real solution, but you can try the following:

  • Change your app's bundle ID and try it again. If you change it, clean your app, and change back, some people have reported success with seeing their icon show up.
  • Log in as another user. The caching Notification Center uses may be per-user, so you might be able to get the properly-iconned notifications as a different person.

Solution 4

The folder location has been moved for OSX 10.10+.

Following command takes to you to its new location:

$ cd `getconf DARWIN_USER_DIR`/com.apple.notificationcenter/db               

and then

$ open .

Solution 5

I tried all of the above suggestions but the only thing that worked for me on 10.14 was to delete DerivedData:

rm -rf ~/Library/Developer/Xcode/DerivedData

Share:
11,159

Related videos on Youtube

phatduckk
Author by

phatduckk

Founder Jeraff, Inc - previously lead of core infrastructure team @ Digg, creator/led at Blip.fm before that.

Updated on June 10, 2022

Comments

  • phatduckk
    phatduckk about 2 years

    I'm using OSX's Notification Center APIs for the first time and can't seem to figure out how to make my app's icon to show up in the Notification badge.

    The default "your app doesn't have an icon" icon keeps showing up:

    Here's what I've done so far

    • I have created an icns file that includes 512, 256, 128, 32 & 16px versions
    • dragged the icon into the "App Icon" section of the target's summary
    • I made to sure to check the box to copy the icon into the project
    • the plist's "Icon file" section references the correct icon name (minus the .icns) part

    Any ideas? The icon doesn't show up when I run the app thru Xcode or when I export an archive either.

    I also have extracted the Sparrow.icns file from Sparrow.app and tried using that one instead of the one I made. That didn't work either.

  • phatduckk
    phatduckk almost 12 years
    Changing the bundle ID did the trick. Pretty lame bug. I wonder what happens to upgrades from the AppStore.
  • StuFF mc
    StuFF mc over 11 years
    These devforums links solved my problem. For the record, I had moved an old version of my App in /Application. This is where Notification Center was "getting" the icon from, and this old version had a broken Icon (bad .iconset). Trashing this version and restarting the Notification Center fixed my problem!
  • Vipin Johney
    Vipin Johney about 11 years
    I tried this, but even after that the notification shows the apple's default icon. But when I login as another user icon comes correctly in the notification. Is there any way to clear all the cache or something like that?
  • Patrick
    Patrick over 9 years
    Confirmed working on OS X 10.10.2. Definitely the cleanest way to accomplish the goal.
  • someguy234
    someguy234 about 9 years
    Yep working! And you can change it back to original after you get the new icon showing. :)
  • Cripto
    Cripto over 8 years
    Confirmed working on 10.11.4 Beta (15E27e) and xCode 7.2 (7C68)
  • Obj-Swift
    Obj-Swift almost 8 years
    @mKane which OS version are you on? might have changed recently.
  • mKane
    mKane almost 8 years
    was on 10.11.4 I think when posted now I am on 10.12 b6
  • Kilian
    Kilian almost 8 years
    This worked for me, the directory has changed however with 10.10 to $(getconf DARWIN_USER_DIR)/com.apple.notificationcenter/db. I deleted the file db and killed Notification Center via Activity Monitor.
  • Daniel Paul Searles
    Daniel Paul Searles over 7 years
    That's a bummer. To be honest I've not used xCode much on 10.12.
  • John
    John over 7 years
    Worked for me on macOS 10.12.2
  • Sodbileg Gansukh
    Sodbileg Gansukh almost 6 years
    Works on macOS 10.12
  • Logan
    Logan over 4 years
    Here's a fun one-liner to delete the DB and kill NotificationCenter based on Kilian's helpful comment: rm -rf $(getconf DARWIN_USER_DIR)/com.apple.notificationcenter/db && kill -9 `ps -A | grep "[^(grep )]MacOS\/NotificationCenter" | awk '{print $1}'`