OSX Notification Center Icon
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
Related videos on Youtube
phatduckk
Founder Jeraff, Inc - previously lead of core infrastructure team @ Digg, creator/led at Blip.fm before that.
Updated on June 10, 2022Comments
-
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.
-
Mil0R3 almost 12 yearsPossible Duplicate: stackoverflow.com/questions/11770961/…
-
phatduckk almost 12 yearsI tried that - didn't work. cl.ly/image/3d1P271a0I3h cl.ly/image/1P0F2Z0o3a09
-
Mil0R3 almost 12 yearsThat's puzzle, I used Icon Composer to make a icon.icns from icon.png,and then draged it to the target in Xcode,it would auto add to the plist, every thing was ok.
-
phatduckk almost 12 yearsChanging the bundle ID did the trick. Pretty lame bug. I wonder what happens to upgrades from the AppStore.
-
StuFF mc over 11 yearsThese 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 about 11 yearsI 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 over 9 yearsConfirmed working on OS X 10.10.2. Definitely the cleanest way to accomplish the goal.
-
someguy234 about 9 yearsYep working! And you can change it back to original after you get the new icon showing. :)
-
Cripto over 8 yearsConfirmed working on 10.11.4 Beta (15E27e) and xCode 7.2 (7C68)
-
Obj-Swift almost 8 years@mKane which OS version are you on? might have changed recently.
-
mKane almost 8 yearswas on 10.11.4 I think when posted now I am on 10.12 b6
-
Kilian almost 8 yearsThis worked for me, the directory has changed however with 10.10 to
$(getconf DARWIN_USER_DIR)/com.apple.notificationcenter/db
. I deleted the filedb
and killed Notification Center via Activity Monitor. -
Daniel Paul Searles over 7 yearsThat's a bummer. To be honest I've not used xCode much on 10.12.
-
John over 7 yearsWorked for me on macOS 10.12.2
-
Sodbileg Gansukh almost 6 yearsWorks on macOS 10.12
-
Logan over 4 yearsHere'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}'`