Skip to content
Jamf-ConceptsPublic

About

Notifier is a Swift app which can post alert or banner notifications on macOS 12.0+ clients.

Resources

Security policy

Stars

178 stars

Watchers

17 watching

Forks

Latest commit

ย 

History

279 Commits

Folders and files

NameName
Last commit message
Last commit date
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

Licensed under the Apache License, Version 2.0 Copyright 2026 Jamf.

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Notifier

Alert

Notifier is a Swift app which can post alert or banner notifications on macOS 12.0+ clients.

Notifications are delivered via the UserNotifications Framework

Usage

Basic Usage

OVERVIEW: Notifier 4.0: Posts alert or banner style notifications to the logged-in user.

USAGE: --type <alert|banner> --message <message> [options]
       --type <alert|banner> --message <message> --messageaction <action>
       --type <alert|banner> --message <message> --messagebutton <label> --messagebuttonaction <action>
       --type <alert|banner> --message <message> --messagebutton <label> --messagebutton2 <label> --messagebutton2action <action>
       --type <alert|banner> --message <message> --messagedismissaction <action>
       --type <alert|banner> --remove prior --message <message> [options]
       --type <alert|banner> --remove all
       --rebrand <path to image>

NOTIFICATION ACTIONS:
  --messageaction <messageaction>
                          The action to perform when the notification body is clicked.
        		 Each action option applies to a different interaction point on the notification:

        		 โ€ข --messageaction        - Fires when the notification body itself is clicked.
        		 โ€ข --messagebuttonaction  - Requires --messagebutton. Fires when --messagebutton is clicked.
        		 โ€ข --messagebutton2action - Requires --messagebutton2. Fires when --messagebutton2 is clicked.
        		 โ€ข --messagedismissaction - Fires when the user clicks the (X) to explicitly dismiss the notification.

        		 The following values can be passed to any action option:

        		 โ€ข 'logout'              - Prompts the logged-in user to log out.
        		 โ€ข A single path or URL  - Opened via /usr/bin/open (e.g. https://example.com).
        		 โ€ข A binary path + args  - The first argument must be a full path to a binary.

        		 For example: "/usr/bin/open" will work, "open" will not.

  --messagebuttonaction <messagebuttonaction>
                          The action to perform when --messagebutton is clicked. Requires --messagebutton to be passed. See --messageaction for format details.

  --messagebutton2action <messagebutton2action>
                          The action to perform when --messagebutton2 is clicked. Requires --messagebutton2 to be passed. See --messageaction for format details.

  --messagedismissaction <messagedismissaction>
                          The action to perform when the user clicks the X button to explicitly dismiss the notification. See --messageaction for format details.


OPTIONS:
  --type <type>           The notification style to post. Must be either:

                          โ€ข alert  - Persistent notification that remains until the user dismisses or interacts with it.
                          โ€ข banner - Temporary notification that auto-dismisses after a short time.

                          The user's Notification Center settings for this application may override the requested style.

  --message <message>     The main body text of the notification.

  --messagebutton <messagebutton>
                          Adds an action button to the notification with the given label. Pass --messagebuttonaction to run a command when the button is clicked.

  --messagebutton2 <messagebutton2>
                          Adds a second action button to the notification with the given label. Requires --messagebutton to also be passed. Pass --messagebutton2action to run a command when this button is clicked.

  --rebrand <rebrand>     Path to a PNG or ICNS image to use as the notification icon, replacing the default app icon.

                          Requires root privileges. The calling process must have either Full Disk Access (macOS 10.15+) or App Management (macOS 13+) permission, and the notifying applications must be permitted to post to Notification
                          Center. These permissions can be granted manually or via PPPC profiles delivered by an MDM.

                          If successful and a user is logged in, Notification Center is restarted to apply the change.

  --remove <remove>       Removes previously delivered notifications. Pass either:

                          โ€ข prior - Removes the notification matching the current --type, --message, and any other passed flags. All flags used when originally posting the notification must be passed again.
                          โ€ข all   - Removes all notifications delivered by this application.

  --sound <sound>         The sound to play when the notification is delivered. Pass "default" for the standard macOS notification sound, or the name of a sound file in /Library/Sounds or /System/Library/Sounds (without the file
                          extension).

                          If the named sound cannot be found, macOS will fall back to the default sound.

  --subtitle <subtitle>   Secondary line of text displayed below the title in the notification.

  --title <title>         The bold title line displayed at the top of the notification. Defaults to the application name if not passed.

  --verbose               Enables detailed progress logging via NSLog. View output in Console.app by filtering for 'Notifier'.

  --help                  Show help information.

Examples

The below aim to give you an idea of what so the various notification options look like, across macOS versions as well as Light and Dark mode.

As you can see, some of the behaviour and appearence is OS dependent.

Example 1 This example shows a basic banner notification.

macOS 10.15.7 - Light Mode macOS 14.3 - Dark mode
/Applications/Utilities/Notifier.app/Contents/MacOS/Notifier --type banner --message "message"

Example 2 This example shows a basic alert notification.

macOS 10.15.7 - Light Mode macOS 14.3 - Dark mode
/Applications/Utilities/Notifier.app/Contents/MacOS/Notifier --type alert --message "message" --messagebutton "Logout" --messagebuttonaction "Logout"

Example 3 This example shows both alert & banner notifications, (sleep used for the example gif, not needed in use but below for completeness sake).

macOS 10.15.7 - Light Mode macOS 14.3 - Dark mode
/Applications/Utilities/Notifier.app/Contents/MacOS/Notifier --type alert --message "Please Logout" --messagebutton "Logout"  --messagebuttonaction "logout" --title "Logout";
/bin/sleep 2;
/Applications/Utilities/Notifier.app/Contents/MacOS/Notifier --type banner --message "๐Ÿ‘‹" --title "Notification"

Example 4 This example shows selective remove of a delivered notificaition via --remove prior. Where applicable this would also remove notifications from within Notification Center itself.

macOS 10.15.7 - Light Mode macOS 14.3 - Dark mode
/Applications/Utilities/Notifier.app/Contents/MacOS/Notifier --type alert --message 'Look at me!!';
/bin/sleep 2; 
/Applications/Utilities/Notifier.app/Contents/MacOS/Notifier --type alert --message "message" --messagebutton "Logout";
/Applications/Utilities/Notifier.app/Contents/MacOS/Notifier --type alert --message 'Look at me!!' --remove prior

Example 5 This example shows removal of all alert notifications and also the differences of delivery of alert notifications across macOS versions, additionally this removes any prior delivered notificaions from Notification Center. Sleep used for the example gif, not needed in use but below for completeness sake.

macOS 10.15.7 - Light Mode macOS 14.3 - Dark mode
/Applications/Utilities/Notifier.app/Contents/MacOS/Notifier --type alert --message message;
/Applications/Utilities/Notifier.app/Contents/MacOS/Notifier --type alert --message message1;
/Applications/Utilities/Notifier.app/Contents/MacOS/Notifier --type alert --message message2;
/Applications/Utilities/Notifier.app/Contents/MacOS/Notifier --type alert --message message3;
/Applications/Utilities/Notifier.app/Contents/MacOS/Notifier --type alert --message message4;
/Applications/Utilities/Notifier.app/Contents/MacOS/Notifier --type alert --message message5;
/bin/sleep 5;
/Applications/Utilities/Notifier.app/Contents/MacOS/Notifier --type alert --remove all

Example 6 This example shows Notifier 3.0+'s --rebrand argument in use, this allows for rebranding of Notifier without having to venture into Xcode etc.

macOS 10.15.7 - Light Mode macOS 14.3 - Dark mode
/Applications/Utilities/Notifier.app/Contents/MacOS/Notifier --type alert --message "message";
/Applications/Utilities/Notifier.app/Contents/MacOS/Notifier --type banner --message "message";
/bin/sleep 2;
/usr/bin/sudo /Applications/Utilities/Notifier.app/Contents/MacOS/Notifier --rebrand /System/Library/CoreServices/CoreTypes.bundle/Contents/Resources/ErasingIcon.icns;
/bin/sleep 2;
/usr/bin/sudo /Applications/Utilities/Notifier.app/Contents/MacOS/Notifier --type banner --message "message";
/Applications/Utilities/Notifier.app/Contents/MacOS/Notifier --rebrand /System/Library/CoreServices/CoreTypes.bundle/Contents/Resources/GenericFileServerIcon.icns;
/bin/sleep 2;
/usr/bin/sudo /Applications/Utilities/Notifier.app/Contents/MacOS/Notifier --type banner --message "message";
/Applications/Utilities/Notifier.app/Contents/MacOS/Notifier --rebrand /Applications/Utilities/Notifier.app/Contents/Resources/AppIcon.icns;
/bin/sleep 2;
/Applications/Utilities/Notifier.app/Contents/MacOS/Notifier --type banner --message "message"

Deployment

PPPC

It's recommended that the below profile is recommended to be deployed before Notfier itself, to UAMDM devices. (https://github.com/Jamf-Concepts/Notifier/blob/master/profile/Allow%20Notifier%20Notifications.mobileconfig)

This will allow Notifier to post Notifications without prompting the user to allow.

Additionally, if you're looking to make use of the --rebrand flag the calling process needs either Full Disk Access/SystemPolicyAllFiles (10.15+) or at a minimum App Management/SystemPolicyAppBundles (macOS 13+) permissions, as well as the notifying applications being given permission to post to Notification Center.

Any of these permissions can be granted manually, but ideally via PPPCP's delivered via an MDM.

PKG

PKG's will be supplied for every release, & can be found in the releases section.

Flow

The below is the advised deployment flow for Notifier.

  1. If rebranding - deploy a PPPC for your management tool of choice, granting either Full Disk Access/SystemPolicyAllFiles (10.15+) or App Management/SystemPolicyAppBundles (macOS 13+).
  2. Deploy the Notications PpPC to UAMDM devices
  3. Deploy the latest Notifier PKG
  4. If rebranding - deploy the image to use when rebranding.
  5. if rebranding - deploy a script or payload free package etc which rebrands Notifier via your management tool. This needs to be down with admin/root privileges.

How it works

The main Notifier.app parses arguments passed to it (via Argument Parser, and then posts the parsed argument to the two notifying applications included with the the /Contents/Helpers folder of Notifier.app:

/Applications/Utilities/Notifier.app/Contents/Helpers/
                                                      Notifier - Alerts.app
                                                      Notifier - Notifications.app

Additionally the Notifier.app also checks tha Notification Center is running, & runs the notifying apps in the user context.

The notifying apps (/Applications/Utilities/Notifier.app/Contents/Helpers/Notifier - Alerts.app and /Applications/Utilities/Notifier.app/Contents/Helpers/Notifier - Notifications.app) both post notifications via the UserNotifications Framework.

Miscellaneous

Resetting Notifications Center

The below should reset Notifications Center, but please test & submit a PR with a better method as applicable.

  1. /bin/rm -rf $(getconf DARWIN_USER_DIR)/com.apple.notificationcenter/*
  2. Logout & then log back in, or:
  • For macOS 10.15+: /usr/bin/killall "NotificationCenter"
  1. Test the Notifier once more

FAQs

Q1: Why start at version 2?

A1: When dataJAR created this, they already had a v1 "Notifier" app deployed.

Q2: How can you post both banner & alert notifications?

A2: See How it works

Q3: The users are being prompted to allow.. help!

A3: This can be due to a few things:

  1. Was the notifications profile installed? If not, install.
  2. Is the device under UAMDM? If not, check with your MDM vendor on making the device UAMDM. Then try again & maybe reinstall the profile once under UAMDM.
  3. Did you change the Bundle ID of either the Alert or Banner applications? If so you'll need to amend the notifications profile accordingly.

Q4: Is that logo magen...

A4: No, it's a shade of pink...

Q5: Banner or Notifications?

A5: The temporary notifications are referred to as "banner" notifications in Apple's documentation, but it seems that most folks call them "Notifications" with the persistent notifications being referred to as alerts by folks as well as within Apple's documentation.

Q6: I'm seeing alerts when expecting banner notifications, & vice versa

A6: Check the Notification settings within System Preferences/System Settings, it's possible that the incorrect option has been selected or set via a profile.

Q7: --remove prior, didn't clear my last message.

A7: Make sure you pass EXACTLY the same message to be cleared.

Q8: I've rebranded, but the old icon is being shown..

A8: Please reset Notification Center as per the Resetting Notifications Center, then try again.

Q9: Does rebranding work when no one is logged in?

A9: Yep, and no restart of Notification Center is needed.

Q10 Why are notifcations all of a sudden showing a prohibted sign across the icon?

A10 This is a macOS issue that has goes back some years, to resolve either restart Notification Center or the Mac.

Q11 Why does rebranding no longer work on macOS 26.4?

A11 This seems to have been an Apple change. Feedback has been filed, but no response as of yet. Once there is a reponse we can look to amend this appropriately.

Q12: Why the jump to version 4?

A1: With version 4, Notifier's bundle id's, notarisation and signing changed to Jamf. This needs new profiles being deployed etc, so a major version bump seemed reasonable.

Alternatives

The below projects can be used instead of Notifier & were very much instrumental in Notifiers creation

Alert Notifications

Yo

Banner Notifications

Terminal Notifier

About

Notifier is a Swift app which can post alert or banner notifications on macOS 12.0+ clients.

Resources

Security policy

Stars

178 stars

Watchers

17 watching

Forks

Releases

Packages

Used by

Contributors

Languages