Web Push Notifications Done Right

Rate this content
Bookmark

Finally, Web Push API is available in all major browsers and platforms. It's a feature that can take your users' experience to the next level or... ruin it! In my session, after a tech intro about how Web Push works, we'll explore implementing smart permission request dialogues, various types of notifications themselves, and communicating with your app for more sophisticated scenarios - all done right, with the best possible UX.

This talk has been presented at JSNation 2023, check out the latest edition of this JavaScript Conference.

FAQ

Web push notifications are messages sent to users' devices via web browsers. They can include a title, body text, icons, images, and actions, and are delivered even when the application is closed.

The main advantage of web push notifications is their ability to reach users regardless of the application state, even if the app or browser is closed.

A web push notification can include a title (required), body text, icons, images, and actions. Some components are provided by the system, like the browser icon and origin.

It's important to be polite because modern browsers protect users from unwanted notifications. Developers should use web push notifications as a last resort and provide clear information before asking for permission.

Developers should only initiate a subscription request after an explicit action from the user. They should first show a soft prompt explaining the content and frequency of notifications before requesting permission.

Best practices include sending timely, personal, and relevant notifications, avoiding mass broadcasts, using clear calls to action, and leveraging emojis for better engagement.

As of iOS 16.4 and the latest macOS, 80% of Internet users can technically receive web push notifications, making them widely supported across major platforms.

A soft prompt should include information about the messaging channel, the type of content, frequency of notifications, and how users can unsubscribe.

Developers should avoid mass broadcasts because web push notifications are more effective when they are transactional, timely, and relevant to individual users.

Developers can find more resources, including extended presentations and technical details, on the app created by Maxim Salnikov for testing web push notifications on multiple devices.

Maxim Salnikov
Maxim Salnikov
11 min
05 Jun, 2023

Comments

Sign in or register to post your comment.

Video Summary and Transcription

Let's talk about web push notifications and their benefits. Web push notifications have higher opt-in and click rates compared to traditional methods. The web push API should be used responsibly, with subscription requests initiated only after explicit user action. Improve engagement by using emojis in notifications. Connect with the speaker on LinkedIn for more information about the web push API.

1. Introduction to Web Push Notifications

Short description:

Let's talk about web push notifications. I'll share tips on using this powerful API. Web push works regardless of the application state, allowing notifications to arrive even if the app or browser is closed.

Hello, dear developers. Let's talk about web push notifications. In this short session, I'll share some tips and tricks on how to use this extremely powerful API for good. My name is Maxim Salnikov, I live and work in Oslo, Norway, I do developer engagement in Microsoft, and I'm a big, big fan of the developer communities.

I run few meetups, conferences, and you often find me presenting about web and cloud technologies on the stages of meetups and conferences. And you know what, folks? Let's stay on this slide for a couple more minutes because using this set of information pieces, I want to explain or remind you what is web push notification.

First of all, let's pretend that this is a notification that came to either our or our user's device, and it has a title. Actually, this is the only required component of a notification's API notification object, but definitely you want to use more components of it, like a body. This is actually main text of the notification. Also, many platforms support relatively small, at least by specification, graphical components, called icons that is normally placed somewhere close to the title and body. Then, actions. All platforms support at least generic actions when users click or tap on the notification bubble, and some platforms support even multiple set of the actions, where we provide name, icon, and actually what to do. You write the code yourself, of course. Some platforms support larger graphical component called Image in Notification API. These are pieces of information we send as developers or business owners. Also, there are some components provided by the system or operating system itself, because we want to let users know where this notification came from, and maybe they can take some extra actions. First of all, we talk about Web Push notifications. This is why there is always an icon of the browser where the application was running. Also, there is an origin where this notification came from, and a set of, let's say, extra actions, either as a menu item or a three dot item expanded to some extra actions. It's for the users to react somehow on, for example, unwanted notifications. They can either block the sender, or the browser, or notifications in general. That really depends on a particular platform, this set of features. This is anatomy of web push notifications, if you wish.

Then, let me provide some motivations. Why using web push notifications is a really nice way to reach out to your users. First of all, compared to all other ways we can organize communication between us, as developers or business owners, and users of our web app, web push has a very important advantage. It works regardless of the application state. So once subscribed, users can close application, application tab, they can close the browser, notification will arrive anyway. Of course, this is because modern browsers, they always have some background service component that is always on duty. This is how all this works.

2. Benefits of Web Push Notifications

Short description:

Compared to traditional methods like SMS, web push notifications have higher opt-in and click rates. They are also more cost-effective due to the free delivery channel. Additionally, with 80% of Internet users now able to receive web push notifications, the potential reach is significant.

Compared to older or conservative or traditional ways to reach out to our users, for example, Push has way higher opt-in and click rates, compared to other traditional ways to reach out to users like, for example, SMS, it's way cheaper. And actually, since the delivered channel is completely free, we cannot even say how many times cheaper because we cannot divide by zero, right?

Then, I hope that my previous slide convinced you that the format itself is quite rich with different ways to express what we want to deliver to the user. And after all, it's at least relatively easy to set everything up and you can start sending message immediately. Of course, after your user's subscribed. And last but not least, motivation point is this one. After arrival of iOS 16.4 and the latest macOS, we now have 80% of Internet users who are technically can receive web push notifications. I think this is very impressive number.

Check out more articles and videos

We constantly think of articles and videos that might spark Git people interest / skill us up or help building a stellar career

Install Nothing: App UIs With Native Browser APIs
JSNation 2024JSNation 2024
31 min
Install Nothing: App UIs With Native Browser APIs
This Talk introduces real demos using HTML, CSS, and JavaScript to showcase new or underutilized browser APIs, with ship scores provided for each API. The dialogue element allows for the creation of modals with minimal JavaScript and is supported by 96% of browsers. The web animations API is a simple and well-supported solution for creating animations, while the view transitions API offers easy animation workarounds without CSS. The scroll snap API allows for swipers without JavaScript, providing a smooth scrolling experience.
Pushing the Limits of Video Encoding in Browsers With WebCodecs
JSNation 2023JSNation 2023
25 min
Pushing the Limits of Video Encoding in Browsers With WebCodecs
Top Content
This Talk explores the challenges and solutions in video encoding with web codecs. It discusses drawing and recording video on the web, capturing and encoding video frames, and introduces the WebCodecs API. The Talk also covers configuring the video encoder, understanding codecs and containers, and the video encoding process with muxing using ffmpeg. The speaker shares their experience in building a video editing tool on the browser and showcases Slantit, a tool for making product videos.
Remix: Embracing Web Standards to Redefine Modern Web Development
React Advanced Conference 2023React Advanced Conference 2023
26 min
Remix: Embracing Web Standards to Redefine Modern Web Development
Top Content
Watch video: Remix: Embracing Web Standards to Redefine Modern Web Development
Remix is a web development framework that combines the scalability of server-rendered frameworks with the flexibility of React. It prioritizes web standards and best practices for security. Remix streamlines development with web standards like URLs, fetch API, HTML, and HTTP caching. It simplifies data handling through HTML forms and HTTP, improving user experience. Httpication in Remix reduces server load and speeds up response time, while global search and Storyblock make building complex websites easier.
What is "TC39: Type Annotations" aka the Types as Comments proposal
TypeScript Congress 2023TypeScript Congress 2023
27 min
What is "TC39: Type Annotations" aka the Types as Comments proposal
The TC59 Type Annotations proposal, also known as Types with Comments, introduces the ability to run typed code in JavaScript. It aims to bring TypeScript back into JavaScript and create a separation between type system and runtime. TypeScript's popularity is on par with JavaScript, raising concerns about the influence of Microsoft. The proposal progresses by addressing runtime interaction and token soup in type specifications. Research, community involvement, and quantifying the effects of supporting this comment style are important goals.
Visualising Front-End Performance Bottlenecks
React Summit 2020React Summit 2020
34 min
Visualising Front-End Performance Bottlenecks
React's web-based tools allow for independent learning. Dazzone, a sports streaming service, faces challenges with low memory and CPU targets. Measuring, analyzing, and fixing performance issues is crucial. Virtualization improves rendering efficiency and performance. The application is now much faster with significantly less jank.
WebHID API: Control Everything via USB
JSNation 2022JSNation 2022
23 min
WebHID API: Control Everything via USB
Today's Talk introduces the webHID API, which allows developers to control real devices from the browser via USB. The HID interface, including keyboards, mice, and gamepads, is explored. The Talk covers device enumeration, input reports, feature reports, and output reports. The use of HID in the browser, especially in Chrome, is highlighted. Various demos showcase working with different devices, including a DualShock controller, microphone, gamepad, and Stream Deck drum pad. The Talk concludes with recommendations and resources for further exploration.

Workshops on related topic

Writing Universal Modules for Deno, Node and the Browser
Node Congress 2022Node Congress 2022
57 min
Writing Universal Modules for Deno, Node and the Browser
Workshop
Luca Casonato
Luca Casonato
This workshop will walk you through writing a module in TypeScript that can be consumed users of Deno, Node and the browsers. I will explain how to set up formatting, linting and testing in Deno, and then how to publish your module to deno.land/x and npm. We’ll start out with a quick introduction to what Deno is.