Remove application from Notification Center

前端 未结 11 1785
自闭症患者
自闭症患者 2020-12-08 01:21

Hey 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

相关标签:
11条回答
  • 2020-12-08 02:05

    The following, perhaps heavy-handed approach seems to work for me when I get into this mess. It avoids changing AppID/etc. at least.

    1. Quit XCode
    2. rm -rf ~/Library/Developer/Xcode/DerivedData/*
    3. killall usernoted
    4. killall NotificationCenter
    5. rm ~/Library/Application Support/NotificationCenter/*
    6. Open System Preferences → Notifications (this seems to restart everything)

    Reboot/log out is not required in this method.

    0 讨论(0)
  • 2020-12-08 02:07

    I was trying to remove a notification, but in my case it was for a website (9to5mac) to be exact. I could SEE it in System Preferences | Notifications and set it to be disabled, but I continued to get notifications. I finally figured it out. For websites you have to go into Safari, then Safari Preferences | Websites, then Notifications, then find the website and either set it to Deny or just remove it altogether. I removed 9to5mac here and once I did, it was gone from the general Notification Center as well, what a pita! but at least there is a way.

    Also from my searching I too opened the notification DB file with a sqlite browser and my web notification "app" was not to be found, so you have to delete/disable it in Safari instead.

    0 讨论(0)
  • 2020-12-08 02:08

    I simply renamed the file in the NotificationCenter folder, then rebooted. A new file was created which was populated with just the default apps.

    0 讨论(0)
  • 2020-12-08 02:09

    Highlight the app in the list and hit fn+backspace or del/delete if you have that on your keyboard.

    0 讨论(0)
  • 2020-12-08 02:17

    Change the code in the project which you were playing around with user notifications in to call

    [[NSUserNotificationCenter defaultUserNotificationCenter] removeAllDeliveredNotifications];
    

    from your app delegate's method -applicationDidFinishLaunching:. This will remove all user notifications from the user notification center.

    0 讨论(0)
提交回复
热议问题