Reputation: 33
I used C#/Mono to schedule a notification with NSUserNotificationCenter
like so:
var not = new NSUserNotification();
not.Title = ...;
not.DeliveryDate = ...;
not.DeliveryRepeatInterval = new NSDateComponents() {
Second = 65
};
...
NSUserNotificationCenter.DefaultUserNotificationCenter
.ScheduleNotification(not);
This worked as intended. An initial notification appeared and then after a 65sec delay the next one and then the next one etc.
But: After I quit the application the notifications kept appearing! And they still do.
I deleted the application and emptied the trash can. I restarted my Mac. I switched notifications for the application on/off in settings/notification center. All to no avail.
I followed advice to delete SQLite notification databases down in the belly of OSX Sierra. There were only old .db files. Nothing changed.
Neither can I remove the application from the notification center, nor can I stop the scheduled notifications.
What else can I do?
PS: To be precise: I checked this posting, but nothing from there worked.
Upvotes: 0
Views: 584
Reputation: 33
Ok, I solved the problem myself. The solution indeed was already present in the previous posting. But I somehow did not apply it correctly. So here are the steps if you're stuck with unwanted notifications on OSX Sierra:
cd (getconf DARWIN_USER_DIR)/com.apple.notificationcenter/db
(replace the ()
with backticks!)pwd
, e.g. /var/folders/b4/qw_sstpn1jqd8ypb1zgc7vww0000gn/0/com.apple.notificationcenter/db
. This references a directory, not a file yet!db
in the directory found, e.g. /var/folders/b4/qw_sstpn1jqd8ypb1zgc7vww0000gn/0/com.apple.notificationcenter/db/db
- yes, it's db/db
at the end - with a SQLite editor.select * from app_info where bundleid = "%yourappname%". Remember the
app_id` value shown.delete from app_info where app_id = <your app id>
.I first was confused by my app still being listed in settings/notifications. But at least the annoying notifications don't appear anymore.
Good luck for you!
Upvotes: 1