No More Posting New Topics!

If you have a question or an issue, please start a thread in our Github Discussions Forum.
This forum is closed for new threads/ topics.

Navigation

    Quasar Framework

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search

    How to use oneSignal for push notification with Quasar PWA ?

    Help
    4
    4
    1415
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • F
      Felwin last edited by

      oneSignal documentation states that other service worker should be imported into oneSignal’s one or it wouldn’t work, doing that :

      importScripts('https://site.com/my-other-service-worker.js');
      

      How can I make this requirement compatible with quasar PWA service worker ?

      1 Reply Last reply Reply Quote 0
      • M
        motia last edited by

        I have created a package that supports on pwa and spa modes.

        https://github.com/motia/quasar-app-extension-onesignal

        You will need to add the pwa mode to your quasar app. then modify the src-pwa/register-service-worker.js to register OneSignalSDKWorker.js.
        The package will create a OneSignalSDKWorker.js at the root of your app with the following content

        importScripts('/service-worker.js?xxxxx', 'https://cdn.onesignal.com/sdks/OneSignalSDKWorker.js'); 
        
        E 1 Reply Last reply Reply Quote 0
        • C
          ChrisO last edited by

          @motia I’m trying to use your package to integrate OneSignal with our app. I’ve got to the point where there are no visible errors (eg it’s getting the right API key and not complaining about the domain), but app.$oneSignal.setup(apiKey) doesn’t seem to actually be doing anything I can see.

          I’m using OneSignal’s “Typical Site Setup” with a slide prompt. My expectation is that when the setup method is triggered from app.vue, the slide prompt will appear. Does your package require using OneSignal’s Custom Code setting with my own prompt?

          1 Reply Last reply Reply Quote 0
          • E
            ernestocuzcueta @motia last edited by

            @motia said in How to use oneSignal for push notification with Quasar PWA ?:

            ou will need to add the pwa mode to your quasar app. then modify the src-pwa/register-service-worker.js to register

            Thanks motia!
            I checked the package and installed it running:

            • npm install quasar-app-extension-onesignal
            • quasar ext invoke onesignal
              but I don’t know where insert the code wrote in teh documentation of the package
              Whre I should add: “$vm.$oneSignal === {…” in my quasar project?
            1 Reply Last reply Reply Quote 0
            • First post
              Last post