HACKER Q&A
📣 cft

Should I use Web Push Notifications?


I was thinking of adding web push notifications to a web-based instant messenger. Reading https://developers.google.com/web/updates/2015/03/push-notifications-on-the-open-web I realized that even though there's a standard API, each browser uses a proprietary "push service" to which my own server sends messages first, before they are delivered to the user's browser: https://developers.google.com/web/fundamentals/push-notifications/how-push-works

In particular, the last link says: "Each browser can use any push service they want, it's something developers have no control over.". Given this, I wanted to know HN opinion on two questions:

1. Is the latency of these "push services" small enough to be used for the instant messaging notifications?

2. Given the recent news of Google/Apple deplatoforming Parler, and the recent push to deplatform Telegram (e.g. https://www.vox.com/recode/22238755/telegram-messaging-social-media-extremists ), is it wise to rely on Google's push service long term? For example, Google Chrome's endpoint URL is fcm.googleapis.com/fcm/send. Is this an unacceptable business risk to rely on Google for push notifications delivery?


  👤 AlexITC Accepted Answer ✓
From my experience, you get to the Web Push API (or any related technology) when the user is not using your app, otherwise, notify your app directly.

The drawback is that such API is not available on Safari/iOS, if that's on your target audience, I'd try Firebase Notifications or something that works on all platforms.


👤 postalrat
The delays I see are usually a couple seconds. But if the phone is in a deeper sleep it could take a while. But that's true of most types of notifications.

I don't see any particular reason this technology is more vulnerable to deplatforming as the alternatives.