3

How do I use WebPushr in a Nuxt JS PWA to send push notifications. I have followed the guide on their online documentation https://docs.webpushr.com/manual-integration but I can't seem to make it work in Nuxt JS.

// start webpushr code
    (function(w,d, s, id) {
      if(typeof(w.webpushr)!=='undefined')
        return;
      w.webpushr=w.webpushr||function(){
        (w.webpushr.q=w.webpushr.q||[]).push(arguments)
      };
      var js, fjs = d.getElementsByTagName(s)[0];
      js = d.createElement(s);
      js.id = id;js.src = "https://cdn.webpushr.com/app.min.js";
      fjs.parentNode.appendChild(js);
    }(window,document, 'script', 'webpushr-jssdk'));
    webpushr('setup',{
      'key':'my-webpushr-key'
    });
    // end webpushr code

Do I create a plugin to make it work with the provided service worker or I'm missing something ?

Isaac T
  • 406
  • 4
  • 8

0 Answers0