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
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.
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
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.
Let us know once you test it out and we will help you
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.
Hello !
I’ve been trying for a while to make OneSignal work on my Frontity website (Decoupled mode).
I’ve set it up as a wordpress instance, fully configured it there and used it successfully before migrating to Frontity. ATM, there’s a few hundred subscribers from that period, and they still receive notifications when I publish new articles. I’ve setup react-onesignal in my Frontity Project using the same API key as the one setup in WP.
useEffect(() => {
OneSignal.init({
appId: "CENSORED-APPID",
promptOptions: {
customlink: {
enabled: true /* Required to use the Custom Link */,
style: "button" /* Has value of 'button' or 'link' */,
size: "medium" /* One of 'small', 'medium', or 'large' */,
color: {
button:
"#FB4160" /* Color of the button background if style = "button" */,
text: "#FFFFFF" /* Color of the prompt's text */
},
text: {
subscribe:
"Recevoir des notifications" /* Prompt's text when not subscribed */,
unsubscribe: "Ne plus reçevoir" /* Prompt's text when subscribed */,
explanation:
"Vous recevez les notifications." /* Optional text appearing before the prompt button */
},
unsubscribeEnabled: true /* Controls whether the prompt is visible after subscription */
}
}
});
}, []);
Their SDK seems to load and is present in the console, doesn’t return console errors in prod (it does in local because the URL is localhost). However it doesn’t seem that any service-worker is pushed. Has anyone ever done that and might give me hints or steps to follow ? Thanks !