About Notifications for Websites
Notifications are concise, unobtrusive messages that appear in the top-right corner of the screen, alerting Mac users about a new message or a completed task. As a web developer, you can configure your website to send notifications to Mac users, even if you don’t have a native Cocoa app.
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).
Local Notifications, which are specified by a W3C standard and triggered locally using JavaScript.
At a Glance
This document explains the key concepts of notifications for websites and how to implement them in your ecosystem.
Users Control Their Notifications
Review the preferences available to users to better understand how to implement your notification service.
Safari Push Notifications Are Deployed from Your Server
In OS X v10.9 and later, you can send push notifications to your website users. Safari doesn’t need to be open for the notification to appear, and your visitors have control over their notification settings on a per-website basis.
Local Notifications Are Invoked with JavaScript
In OS X v10.8 and later, you can tap into Notification Center through a JavaScript API. After visitors grant permission to receive local notifications, you can trigger notifications to appear as long as the webpage remains in an open tab.
See Also
WWDC 2013: Implementing OS X Push Notifications for Websites shows best practices for implementing push notifications for websites.
Local and Remote Notification Programming Guide describes how to send push notifications to iOS and OS X apps.
WebKit DOM Programming Topics describes other JavaScript APIs available to WebKit browsers.
Safari Web Content Guide describes how to create websites for Safari.
Developer Account Help describes how to manage your developer account.
Copyright © 2018 Apple Inc. All Rights Reserved. Terms of Use | Privacy Policy | Updated: 2018-04-09