I was playing around with making a small cocoa application and using the new Notification Center API in Mountain Lion.
However my app is now present in the notification center settings, together with Calendar, Messages and so on.
As it was just me playing around, I want it to disappear from the list now, but I cannot find anyway to remove it.
I tried several things, dragging it out, holding alt + Right Click and so on.
Where could the (probably a) plist that populates that list be located?
While I don't believe purging applications from Notification Center that have once registered is a documented step, there's clearly some stuff setup to do that.
Here's what I found out:
This data isn't stored in a plist but rather a sqlite database.
If you look into
~/Library/Application Support/NotificationCenter/<id>
(in my case, I only had one directory under NotificationCenter), you'll see an<id>.db
file under the directory.*Poking inside, I see tables like
app_info
,app_source
,presented_notifications
, etc. Furthermore, the schema includes a clean-up trigger that looks like this:Using a sqlite3 client, if you do a
the first column is the
app_id
of your application, the second column is your app's bundleid. Find your application based on the bundleid. Then do awhere
<app_id>
is the correctapp_id
you found using your select command above.After doing this, everything stayed around in Notification Center (both the center and System Preferences). I had to logout and log back in to see the changes take effect, but luckily, my multiple test apps are now gone.
*:
Hofi points out that since macOS 10.10, said SQLite database can be found in the directory returned by shell command:
$(getconf DARWIN_USER_DIR)com.apple.notificationcenter/db
named justdb
.jbg notes that as of macOS Monterey (12.x), the directory path is now:
$(getconf DARWIN_USER_DIR)com.apple.notificationcenter/db2
, and thedb
database'sapp_info
table has been renamed toapp
.