Closed this1-it closed 2 years ago
@this1-it Did you use "Typical Site Setup" on the OneSignal dashboard, if so you may need to set these params on the dashboard instead of in code: https://documentation.onesignal.com/docs/onesignal-service-worker-faq#typical-site-setup---service-worker-customizations
Thank you very much, it's all clear now ! I thought options parameters worked without any setup on dashboard.
@this1-it Good to hear! The code params may only work if you selected "Custom Code Setup" instead of "Typical Site Setup" on the OneSignal dashboard.
I need to change scope of onesignal service worker because my pwa has already a service-worker
app.use(OneSignalVuePlugin, { appId, safari_web_id: "", notifyButton: { enable: true, }, serviceWorkerParam: { scope: "/onesignal/" }, serviceWorkerPath: 'onesignal/OneSignalSDKWorker.js' })
It is the right way ?
I have modified init configuration and placed OneSignalSDKWorker.js in onesignal folder under root Onesignal service worker is not loaded and error in browser indicates file is searched in root folder instead of serviceWorkerPath
Uncaught (in promise) DOMException: Failed to register a ServiceWorker for scope ('https://pwa-example.com/') with script ('https://pwa-example.com/OneSignalSDKWorker.js
of course if I put OneSignalSDKWorker.js at root, there are not errors but service-worker cannot start because of pwa service worker