6

Good morning all,

I have a little app which is using NSNotificationCenter to schedule notifications. I have no problems to access them during runtime and all works fine.

The problem starts when I close the app and restart it. I seem not to have any access to the notifications I scheduled during the first run.

Answers here suggest that there is a .db file in ~/Library/Application Support/NotificationCenter/ but this folder is not there in OS X 10.10 (not hidden, not in any of the other Application Support folders either) but I can see it on my 10.9 partition.

Has anybody an idea where this file is located now or if this functionality has been changed completely and the scheduled notifications are stored elsewhere?

Thanks for any hints, MDschay

Indrajeet
  • 5,490
  • 2
  • 28
  • 43
MDschay
  • 181
  • 1
  • 10

3 Answers3

9

Thanks to some outside help I found out that the .db file location can be seen by doing the following:

  1. Open your Activity Monitor
  2. Seach for the process usernoted
  3. Go to the tab "Open files and ports"

The files listed there also contain the .db files I was searching for and it is in a /com.apple.notificationcenter/db subfolder under /private/var/folders (sorry for not posting the complete path but there are some pices which seem to be unique to each machine or user).

MDschay
  • 181
  • 1
  • 10
  • thank you! I have cross-posted this answer to https://apple.stackexchange.com/a/316355/62716. – Ether Feb 23 '18 at 23:17
  • 2
    awesome find! thank you! also for anyone looking to export this data easily to a .csv with python.... i found this tool... https://github.com/ydkhatri/MacForensics/blob/master/macNotifications.py and i created another post about it here.... https://apple.stackexchange.com/a/331300/295916 – greenhouse Jul 17 '18 at 00:24
3

As in 10.14.6 - Mojavae, it could be found using this command:

lsof -p $(ps aux | grep -m1 usernoted | awk '{ print $2 }')| awk '{ print $NF }' | grep 'db2/db$' | xargs dirname
ychz
  • 533
  • 2
  • 7
  • 15
2

Also can be found using this command:

/usr/bin/getconf DARWIN_USER_DIR
TheWellington
  • 235
  • 6
  • 12