Default Web Push Provider
Engagespot supports web push (or browser push notifications) via our own provider out of the box, to notify your users even if they are not currently on your web app!
Webpush channel will work only if you have configured the in-app channel and installed the in-app component in your web app.
Step 1 - Enable default web push provider
To enable default web push provider, login to your Engagespot Console, goto Channels -> Web Push and enable Default Provider.
Web push notifications are only compatible with websites that have HTTPS enabled, except for when the website is hosted locally (localhost).
Step 2 - Add a service worker to your web app
To enable default web push provider, you need to setup Service Worker on your web app. Don't worry if you haven't heard of it before. We've made it really simple for you.
In your web application's root public folder (In case of React.js, it's the public
folder), create a new file called service-worker.js
.
Copy the following line to the file, and save it.
importScripts('https://cdn.engagespot.co/serviceWorkerv2.js');
For Bubble platform users
If you're setting up web push notifications in Bubble, read this guide instead.
Step 3 - Verify the service-worker installation
You must verify the service worker installation by visiting https://yourwebsite.com/service-worker.js. If it shows NOT_FOUND_ERROR
, then web push notifications will not work.
Step 4 - Subscribe users to web push
As mentioned above, you should install In-App Inbox component in your web app so that users can allow permission to receive web push from your website.
Now you can create a workflow with web push channel and it will be delivered to the user