Build

Sending Desktop Web Notifications from Web Browsers

2 min readPubNub Staff on Mar 4, 2015
Try PubNub Today

Free up to 1MM monthly messages. No credit card required.

Subscribe to our newsletter

By submitting this form, you are agreeing to our Terms and Conditions and Privacy Policy.

This tutorial shows you how to send and receive desktop web notifications in Opera, Firefox, Safari, and Chrome in real time with the PubNub JavaScript SDK.

When we think push notifications, our mind goes mobile. However, not to be overlooked is the power of web notifications, notifications that are pushed to users on web browsers.

We saw the massive growth of the mobile messaging app Yo, so we thought why not turn that app to the web and create “Oi,” a web application that enables you to send Oi to other browser users using web notifications.

Currently with the W3C Web Notifications API, web notifications are supported by Opera, Chrome, Firefox, and Safari, and for the purposes of this blog’s demo, our tutorial is compatible with those four popular browsers.

web notifications tutorial web notification tutorial

We wrote a full web notifications tutorial on building Oi, available on Dev.Opera, the Opera Developer’s blog. All the code you need, as well as a live-working web notifications demo is available on their blog.

For the working demonstration, open up a couple browsers and send messages between to see it in action!

Web Notifications Value

The value of this tutorial is that it combines a couple cool features for web notifications. For one, messages are sent between web browsers in under a 1/4 second, which means there are no delays between sending and receiving the messages.

Chrome-Push-Notifications-Browser-2Also, we’ve built in presence functionality, which gives you real-time insight into who is available to receive the web notifications. If the user closes out of their web browser, they are instantly removed from the list of active users.

Other Web Notifications Resources

More from PubNub

Can Empathy Exist in the Metaverse
News May 16, 20221 min read

Can Empathy Exist in the Metaverse

A roundtable discussion led by PubNub’s COO, Casey Clegg, exploring the topics of what it means to be human in a virtual world.

PubNub Staff

PubNub Staff

How to Advance Telehealth and Virtual Care Technologies
News May 2, 20221 min read

How to Advance Telehealth and Virtual Care Technologies

Dr. Joe Kvedar, Chair of the Board for the American Telemedicine Association, joins our COO, Casey Clegg, to discuss why...

PubNub Staff

PubNub Staff

Another Step Towards Data Security: ISO-27001 Implementation
BuildMay 2, 20221 min read

Another Step Towards Data Security: ISO-27001 Implementation

Today, we are glad to announce that we are currently in the process of implementing ISO-27001 security standards.

PubNub Staff

PubNub Staff