Firefox/Push Notifications
Overview
Push Notifications is a feature that enables web applications to efficiently notify users even when off-site. It's intended as a standards compliant feature utilizing Push API, Notifications API, WebPush Service.
Currently, email is the only reliable way for a web application to contact or notify users on desktop computers. Push Notifications introduces functionality for web applications to contact users when off-site ushering a new level of interactivity. There is a class of web sites where users don't often install mobile apps but do want a casual subscription to content. For example:
- News: get notified from sfgate.com on stories around sports teams, restaurant reviews, current events.
- Consumer: get notified when you've been outbid on ebay.com
- Consumer: get notified when a specific item is posted on craigslist.org
- Messaging: get notified when you get a message on IRCcloud, even when Firefox is closed.
- Enterprise: While working on your laptop, get notified you have a sales lead on salesforce.com
- Games: get notified that it's your turn in a Facebook scrabble game.
Status
Plan of Record - approved 9/18
Desktop:
- Fx44: Ship a quality, basic user-centered experience using Desktop Push Notifications.
Android:
- Fx45-Android-Nightly: Land Push Notifications in Fx44 Nightly and evaluate user experience. (updated 10/15)
Road Map:
- Fx45+: Ship a great Desktop experience using Push Notifications.
Team | Status | Notes |
---|---|---|
Desktop | Yellow | A number of small fixes to land in final iteration. |
Platform | Yellow | Some feature working is pending |
Services | Green | |
DevTools | Yellow | Debugging DevEdition 46 |
Mobile | Yellow | Targetting Fx45 |
Technologies
High Level Diagram
Engineering Master Bug List: https://bugzilla.mozilla.org/showdependencytree.cgi?id=1201571&maxdepth=2&hide_resolved=1
Push Notification contains the following technologies:
Web Notification API
WebAPI landed in Fx22. Can be used without push and service workers, but will be a popular use case.
https://developer.mozilla.org/en-US/docs/Web/API/notification
Service Workers
Service workers is the ability for your browser to run a script in the background enabling offline applications, background processing, and push notifications.
https://developer.mozilla.org/en-US/docs/Web/API/ServiceWorker
Platform: https://wiki.mozilla.org/Service_Workers
Spec: https://slightlyoff.github.io/ServiceWorker/spec/service_worker/index.html
Push API
Web DOM API that enables a website to subscribe a client, upon granting permission, to send events to the client.
https://developer.mozilla.org/en-US/docs/Web/API/Push_API
draft spec: https://w3c.github.io/push-api/
spec: http://www.w3.org/TR/push-api/
Push Server
Mozilla hosted server that brokers the registration and sending of push events from web app servers to clients. Past terms for this include: SimplePush and WebPush which distinguished low level design and protocol support. For web developers, the server architecture may migrate when appropriate, but the WebAPI will remain the same.
Mozilla Push Service: http://mozilla-push-service.readthedocs.org/
Mobile
Mobile is targeting Fx44 to for initial support. Android and iOS will leverage Google Cloud Messaging (GCM) and Apple Push Notification Services (APNS) respectively. Work is done by three teams: Android eng, Android platform, and Services Dev. We will be gathering a list of dependencies on landing this on Android.
Android Bug Tree: https://bugzilla.mozilla.org/showdependencytree.cgi?id=1206207&maxdepth=1&hide_resolved=1
Testing
Testing & QA owner is RyanVM. There's a fairly complex test plan here, considering the permissions dialogs, service workers, and API.
FAQ
What are recent changes from Mozilla's SimplePush prototypes:
- Currently the Push API does not access data in the push message, it simply fires an event in the service worker.
- Push events only work with service workers. SimplePush did not require service workers.
- The web application does not need to be active tab in client session.
- about:serviceworkers can be used to manage running service workers.
- notification permissions cannot be requested inside a service worker, it must be in the web application.
What's the difference between SimplePush and WebPush.
- They use different DOM APIs.
- WebPush is intent on implementing the IETF spec. SimplePush was a Mozilla specific implementation and works with FxOS specifically for Find My Device.
- There are other low level differences in the protocol and background processes.
Communications
email: gGroupsList:
- Public: dev-push@mozilla.org
irc: #push - IRC info: https://wiki.mozilla.org/IRC
Demos
Requires Firefox 42 or later
- Fx, Chrome, Chrome Android: https://people.mozilla.org/~ewong2/push-notification-test/
- http://johnme-gcm.appspot.com/
- Chrome only: https://simple-push-demo.appspot.com/
- Web Notification test: https://people.mozilla.org/~mnoorenberghe/w3c_notifications.htm