Web push notifications for Safari was introduced in OS X maverick. The Apple Push Notifications Service is used to send concise and clickable messages to your website users, on their Mac desktop, even when the safari browser isn’t running. Safari Push Notifications work just like app push notifications. They display your website icon and notification text, which users can click to go right to your website.
A key point to be noted is that push notifications can be delivered to Safari on mac not iphone. Notifications from websites don’t appear on ios.
There are two kinds of notifications for websites:
- Safari Push Notifications, which is an Apple-exclusive technology and triggered remotely using Apple Push Notification service (APNs) These are delivered to customer when Safari is not open
This article is essentially about the Safari Push Notifications.
To integrate push notifications in 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 file called a push package. 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 open a webpage of your choosing in Safari.
Managing notifications: Disable Safari push notifications
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 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.
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. As 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.
Read more on unsubscribing from notifications here
A history of Apple's push notifications
With the opening of App Store in 2008's, Apple's 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 their 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.
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.