Web push notifications setup

Last modification: 2018-07-02 11:14:44

In this tutorial I'll explain how to setup Web Pus notifications. Web push notifications does not work on iOS mobile devices, but they do work. On google chrome, firefox, android phones and most of desktop PC.

Site has to be using HTTPS

  1. Install dependencies. Web Push notifications requires composer to be executed after Live Helper Chat is installed. 7.x PHP version is required.
  2. ./composer.phar update
  3. When you have to generate your private and public keys. https://web-push-codelab.glitch.me
  4. Enter this information in notifications settings window.
  5. Also fill other required fields in notifications settings window.
  6. If you are using themes, notifications can be enabled/disabled per theme. By defaul't it's disabled.
  7. Next you have to download Service Worker file and place it in your domain root folder. https://example.com/sw.lhc.js
  8. If you have done all correctly you should see now bell icon within upvote/downvote icons.
  9. Next after you started chat and visitor clicks notifications icon. You should see a record in back office.
  10. This workflow works only if chat is embeded in widget or page embed mode, but not popup. (Will be done in the future)

When message is send to visitor?

For messages about unread messages from operator to visitor is send using cronjob. Which command is like this

php cron.php -s site_admin -c cron/notifications

We inform visitors about unread messages only if

  1. Last operator message is written within last hour
  2. From last operator message has passed 5 minutes.
  3. Operator message was unread
  4. We have not send this message to visitor yet.

You can always test message service by editing subscription and using "Test notification" tab

Support project

Developing application takes a lot of time. You can support application by donating. There is no company behind this application and it takes away my free time. Every donation matters and does not matter how small it is!

Paypal, one time donation
Monthly donation

comments powered by Disqus