In some respects, my latest Joy of Rails article has been eight years in the making.

It’s been about that long since I started experimenting with Progressive Web Apps and Rails. Now that Rails 8 will make Rails PWA-ready, it’s time more devs took note.

https://joyofrails.com/articles/web-push-notifications-from-rails

Sending Web Push Notifications from Rails

An embedded Web Push demo and deep dive recipe for Web Push notifications for a Ruby on Rails application in advance of Rails 8 Action Notifier.

Joy of Rails
This article has something you won’t find in most posts about Web Push: a working demo! (in supporting browsers and devices) 😅
Web Push is the ability for web apps to trigger native device Notifications even your users are away. They can be an effective way to call attention (sparingly) to important events, like messages on Campfire or upcoming calendar hey.com invites.

Integrating Web Push notifications in your app can be a little tedious. Rails 8 promises to provide a new framework (Action Notifier) to make things easier.

If you want to learn how Web Push works or even how you could add it to your Rails app today, my article can help.

Luckily, the hairy details of Web Push on the server side (like Voluntary Application server Identification (VAPID)) are abstracted away in the web-push Ruby gem.

(I should know, I wrote its initial implementation of the VAPID protocol 😅)

https://github.com/zaru/webpush/pull/26

Implement VAPID authorization by rossta · Pull Request #26 · zaru/webpush

This PR is a work-in-progress and not ready to merge is ready for review. It is a fairly large set of changes internally that should be backwards compatible with webpush using GCM API key, while pr...

GitHub

If you’re looking for even more information about Web Push, check out the Pushpad blog. Not only does Pushpad share a lot of related content, but they also own maintain the web-push Ruby gem.

https://pushpad.xyz/blog

Articles about web push notifications - Pushpad