Is it possible to turn off the Notification Center completely?

JayDuff
Contributor II

Our standardized testing program uses a locked-down browser, and will kick out a tester, if anything tries to do something in the background. We think that a number of students were kicked out of their tests because they set up Mail.app and got a notification.

Rather than try to play cat and mouse with alert settings, is there a way to completely disable the Notification Center? I tried putting Notification* as a Restricted app, that gets killed, but that seems to have had no effect.

We are currently running 10.12.6, but are going to move to Mojave this summer, so I need a solution for each OS.

Under Mavericks, you could disable the LaunchAgent:

launchctl unload -w /System/Library/LaunchAgents/com.apple.notificationcenterui.plist

but that doesn't work under Sierra, so I bet it doesn't work in Mojave either.

Should I just nuke the agent with:

sudo rm -rf  /System/Library/LaunchAgents/com.apple.notificationcenterui.plist

Will I be able to do that in Mojave?

Ideally, I'd like a Configuration Profile that just turns NC completely off, but the closest I have found isa script that turns on Do Not Disturb. There's gotta be a better way, right?

Thanks in advance!

9 REPLIES 9

mm2270
Legendary Contributor III
sudo rm -rf  /System/Library/LaunchAgents/com.apple.notificationcenterui.plist

The above won't work because of SIP, which is the same reason you can't disable the LaunchAgent with the launchctl unload command.

Honestly, I don't know of any good way to disable Notification Center these days. Apple has made it monumentally difficult to turn off some of the services in their OS lately, which is very frustrating. We always seem to have to jump through hoops or use sketchy scripts and other processes to do it, which inevitably end up breaking in the next major OS release.

I wonder if the vendor for your locked down browser can help. Maybe they can make some changes to it that will prevent kicking out a student due to a simple notification, which seems a bit extreme anyway.

sshort
Valued Contributor

A colleague has resorted to placing posters in the computer lab and informing every instructor/proctor to check that Do Not Disturb is enabled before testing. They just instruct the users to option-click the notification center icon in the menu bar to enable, and I believe that remains active for 24 hours before resetting.

mediacollege
New Contributor III

We make use of this script (it affects the user template, works with newly created accounts)

!/bin/sh

postinstall

Get the system's UUID to set ByHost prefs

MAC_UUID=$(system_profiler SPHardwareDataType | awk -F" " '/UUID/{print $3}')

Setup DND on NotificationCenter

for USER_TEMPLATE in "/System/Library/User Template"/* do /usr/bin/defaults write "${USER_TEMPLATE}"/Library/Preferences/ByHost/com.apple.notificationcenterui.$MAC_UUID "dndEnd" -float 1379 /usr/bin/defaults write "${USER_TEMPLATE}"/Library/Preferences/ByHost/com.apple.notificationcenterui.$MAC_UUID "doNotDisturb" -bool FALSE /usr/bin/defaults write "${USER_TEMPLATE}"/Library/Preferences/ByHost/com.apple.notificationcenterui.$MAC_UUID "dndStart" -float 1380 done

exit 0 ## Success
exit 1 ## Failure

JayDuff
Contributor II

@mediacollege

That is cool, but is there anything (other than blocking the preference pane) that keeps users from turning DND off?

MacConsultant
New Contributor II

I created a plist for Notification Center (com.apple.notificationcenterui.plist) that enables Do Not Disturb from 00:00AM to 11:59PM

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict> <key>dndEnd</key> <real>1439</real> <key>dndStart</key> <real>0.0</real> <key>doNotDisturb</key> <false/>
</dict>
</plist>

Then I created a package (+ a rule) to copy the com.apple.notificationcenterui.plist in a folder on the target Mac (/usr/local/)

MacConsultant
New Contributor II

Then I created a rule, that execute at login to run the following script:

CURRENT_USER=$(/usr/bin/stat -f%Su /dev/console)

MAC_UUID=$(system_profiler SPHardwareDataType | awk -F" " '/UUID/{print $3}')

cp /usr/local/com.apple.notificationcenterui.plist /Users/$CURRENT_USER/Library/Preferences/ByHost/com.apple.notificationcenterui.$MAC_UUID.plist

chown $CURRENT_USER /Users/$CURRENT_USER/Library/Preferences/ByHost/com.apple.notificationcenterui.$MAC_UUID.plist

killall NotificationCenter

kacey3
Contributor II

It looks like this has been changed again. I don't see "com.apple.notificationcenterui" on my Monterey system.

Instead, there is "com.apple.ncprefs.pslist", and while it has a dnd setting buried in there, it appears to be encoded in some way since it's just a block of seemingly random characters.

kacey3
Contributor II

No updates to this thread in 16 months. I guess that means a new solution has not been found. My lab and classroom computers have no use for Notification Center (and in fact, it creates more clutter and chaos than anything else) and I would love to get rid of it.

pbileci
New Contributor III

I'm looking for a solution to this as well, now in 2024!