Your first push notifications web app
Google Developers Logo

Progressive Web App Dev Summit

June 20-21, Amsterdam, NL - Learn more

Screenshot of push notification

In this codelab, you’ll learn how to add Push Notifications to web applications.

This will enable you to re-engage users with breaking news and information about new content.

You’ll also learn the basics of service workers.

What you’ll learn

  • Service worker basics: installation and event handling
  • How to set up a Google Cloud Messaging (GCM) account
  • How to add a web manifest
  • Techniques for requesting GCM to send a notification to a web client
  • Notification display
  • Notification click handling

What you’ll need

  • Chrome 42 or above
  • A basic understanding of git, and Chrome DevTools
  • Experience of Promises and service worker would also be useful, but is not crucial
  • The sample code
  • A text editor
  • A terminal window to run command line tools
  • Python or a simple local web server (see below)

Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 3.0 License, and code samples are licensed under the Apache 2.0 License. For details, see our Terms of Service.