Using OnseSignal (PWA, web workers) with Frontity

Hello, I’m not sure if this question would be in the correct thread, but here goes.

My understanding is that Frontity will not be able to support PWA’s until there is an update to the “Customize Webpack Configuration” feature as service workers need to be configured with webpack.

At this moment, I really need to explore webpack further as I do not understand how it works, or really what it does to be honest :sweat_smile:

With that being said though, would the webpack configuration feature be required for adding something like Onesignal to Frontity? My understanding is that Onesignal uses its own service workers and in my regular wordpress installations adds a service worker to the website.

I see that there is a node package and can also be configured with Google Tag Manager with a REST API existing as well.

Could this be a possible solution for now? Or more likely I am missing something as I am still fairly new at this.

I appreciate any feedback and thank you!

Hi @ShaGui,

I’ve moved this thread to this category

Yes, this is correct. This Feature is still in research and there are some other dependencies that need to be solved first (like enabling custom webpack configuration)

To be honest I don’t see a clear way of making this work with Frontity right now. I think there are some things that should be solved first

@luisherranz any thoughts here?

For One Signal you need to:

  • Load their library in the client.
  • Return their service worker.

Returning a service worker is not possible until we add server extensibility: Server Extensibility


EDIT: I have just realized that this is already possible in Embedded mode because the OneSignal WordPress plugin returns the service worker just fine.

What WordPress hosting service are you using @ShaGui?

1 Like

Hi @luisherranz,

I am so sorry for not answering you earlier, I honestly completely forgot to answer this in between the holidays and a crazy start to 2021.

As for your question, the current site I was thinking of is hosted on Bluehost, though I could test it out on a few sites that are hosted on my VPS, I also have a few sites on Siteground.

Are you using or do you plan to use the Embedded mode?

What type of WordPress cache (page cache/CDN) do Bluehost and SiteGround offer, if any?

I hadn’t thought of using it, as when I built the sites the embedded mode wasn’t available, I believe?

Bluehost and SiteGround both allow for integration with Cloudflare as a CDN and page caching with their caching plugins.

I could try it out though as a test! Will take me a few weeks more and likely.

Let us know once you test it out and we will help you :slight_smile:

Also, if I’m not mistaken, @orballo added OneSignal to one of the projects he has been working with. So if you need help with the client-side code part I’m sure we can figure out together as well.

1 Like