Web push notifications for Safari was introduced in OS X maverick. The Apple Push Notifications Service (APNS) is used to send concise and clickable messages to your website users, on their Mac device. Safari Push Notifications work just like App push notifications. These messages/notifications are delivered even when the Safari browser isn’t running. Each notification displays your website icon and text and you can add a landing page URL to direct the user.
Until recently, Safari push notifications were limited to just Mac OS devices. Apple in 2022, announced that it will be rolling support for web push notifications on Safari starting 2023.
There are two kinds of notifications for websites:
- Safari Push Notifications, which is an Apple-exclusive technology and triggered remotely using the Apple Push Notification service (APNs) These are delivered to the user's device, even when the app (Safari) is not open
How can you integrate/enable push notifications on Safari?
To integrate push notifications on your website, you first present an interface that allows the user to opt in to receive notifications. If the user consents, Safari contacts your website requesting its credentials in the form of a push package file. The push package also contains notification assets used throughout OS X and data used to communicate to a web service you configure. If the push package is valid, you receive a unique identifier for the user on the device known as a device token. The user receives the notification when you send the combination of this device token and your message, or payload, to APNs.
Upon receiving the notification, the user can click on it to reach the landing page.
Managing notifications: Disable Safari push notifications
Wondering how to stop notifications on safari? By default, users visiting websites that have enabled Safari Push Notifications, such as the users, will see a banner appear at the top of the window the first time the site is visited. Here, the user can choose whether to allow notifications from the website. These notifications will appear as standard Notification Center alerts whenever the site posts new content or manually sends out a notification, including the appearance of a banner on the top-right of the screen and an entry in the Notification Center.
Web notifications look and work like any other notification alert. Their appearance can be customized by the user in System Preferences to show up as a temporary banner that vanishes on its own, or an alert that must be clicked to dismiss.
Do not disturb
The user can also turn off notifications by service or system-wide using Do Not Disturb, a feature introduced in iOS 6 that will appear on the Mac in OS X Mavericks. On mobile devices, users can set Do Not Disturb to disable incoming notification alerts during a set period, when the screen is asleep or during presentations.
Know how to unsubscribe from web push notifications here.
A history of Apple's push notifications
With the opening of App Store in 2008 to developers, Apple announced it would be setting up a centralized Push Notification Service as a mechanism for allowing apps to respond to updates from outside services without needing to remain active in the background, constantly listening and using the battery.
In addition to greatly lowering the iPhone's battery consumption compared to the prevailing background software model used by BlackBerry and Microsoft's Windows Mobile, Apple also used its new push notification system to power MobileMe's push messaging features.
However, Apple greatly underestimated the overwhelming demand for both apps and push notifications, sending the company back to the drawing board and delaying the rollout of Push notifications until iOS 3.0, after a stress-testing beta program involving the Associated Press and other app developers.
In late 2009, Google, a major iOS developer, filed a patent for "notification of mobile device events," describing a feature it would later add to Android, albeit without a security model like Apple's. This resulted in both an adware/spam plague for Android users, but also bragging rights for Android enthusiasts who can now claim Apple simply copied its Notification Center from Android rather than having laid all the groundwork for touchscreen smartphones, a functional app store and secure, battery efficient notifications system.
In 2010, Apple brought push notifications to the Mac as an API, initially to support FaceTime notifications and then more broadly as a public API in 2011's OS X Lion.
Notification Center (above) appeared on the Mac as an end-user-facing feature in OS X Mountain Lion last year (pictured above), after first making an appearance on Apple's mobile devices in iOS 5 the previous year.
You can very easily choose whether notifications appear as banners, alerts, or not at all. You can also choose to show them on the lock screen and decide how many recent items appear in the Safari Notification Center.