Add push notifications

Bring users back with a tap. Web and mobile push, set up and sending.

Categories: push notifications, notifications, alerts, engagement, onesignal, firebase, fcm, web push, mobile push, retention

Tools that power the Add push notifications stack

Setup guide

  1. OneSignal: Sign up for OneSignal and create a new Web Push app. Add the OneSignal SDK snippet to your site's <head>. OneSignal will automatically prompt visitors to subscribe. Segment subscribers by behavior in the OneSignal dashboard to send targeted re-engagement messages. (open)
  2. Firebase Cloud Messaging: In the Firebase Console, create a project and enable Cloud Messaging. Install the firebase npm package and initialize it with your config object. Call getToken() to retrieve the device token, save it to your database, and use the Admin SDK on your server to push messages to individual tokens or topics. (open)
  3. Pusher Beams: Sign up for Pusher Beams and create a new instance. Install the @pusher/push-notifications-web SDK. Call beamsClient.start() and subscribe the user to an interest matching their user ID. From your backend, call the Beams Publish API to push to that interest whenever a relevant event occurs. (open)
  4. Web Push API: Generate VAPID keys with the web-push npm library. Register a service worker that listens for push events and calls self.registration.showNotification(). On subscription, send the PushSubscription object to your server and use web-push.sendNotification() to deliver messages without any third-party dependency. (open)