1 year, 3 months ago hanineSpectator
Any update please?1 year, 3 months ago AlexKeymaster
YEs we have tried some solutions for this but they are not working .We are still researching on it why its not working .
It works on my localhost . But not on the servers /1 year, 2 months ago hanineSpectator
We could finally found where the issue came from and corrected it, and now the push notifications are working correctly.
First, the issue has no relation to https or http protocol and connection to firebase, it’s just a mistake in a file name.
During the register operation, the plugin was trying to register the service file “service-worker.js” and this is what caused the error.
When we used ad-dons to check the existing services, we found that for the site https://comfortzomeheroes.com/ the service file name was “firebase-messaging-sw.js” instead of “servie-worker.js”. Digging further in the code after we unminified it (there was only minimized js files in the plugin which made the worker more difficult), we found that the file created for the service is “firebase-messaging-sw.js”, so we changed the name of the file to register, and now it woks with no issue.
It would be great if you can include in the plugin the 3 js files unminified, and call the ones minimized in the script calls, this will give us more room as clients for testing purposes and debugging in case of issues.1 year, 2 months ago AlexKeymaster
Hi thanks for providing the solution .
But we followed the same by copying the firebase-messaging-sw.js and putting the service-worker.js file in the root of the website .
Could you please share some more details on this exactly what change you made in the code ?
You don’t need to make any copy of files, firebase-messaging-sw.js is created in the initial loading of the plugin and will be the one to use by plugin.
All you need to do is inside the script files (the 3 js files in “\wp-content\plugins\wplms-push-notifications\assets\js\” change in the function that registers the script the name of the file to register from “/service-worker.js” to “/firebase-messaging-sw.js”.
change this content belwo by the one below it:
We tried the same solution but it did not worked for us .
We would need to debug more on this .
Thanks for all your help suggesting the solution and debugging the issue on your own .This reply has been marked as private.
Hi thanks for the plugin , I will try it out.
We have checked the plugin we uploaded, and the change is actually only in the front-end js file.
Have a good day
Used your plugin but it did not work on our server .Im sure it is related to server .
The topic ‘push notification NOK, console error "Error during service worker registration"’ is closed to new replies.