in firebase-messaging-sw.js
importScripts('https://www.gstatic.com/firebasejs/3.5.2/firebase-app.js'); importScripts('https://www.gstatic.com/firebasejs/3.5.2/firebase-messaging.js
getting error as "importScripts is not defined"
where to include firebase-messaging-sw.js Js file in angular app ? I have included in scripts/firebase-messaging-sw.js .
In index.html
<script src="scripts/firebase-messaging.js"></sc
In your index.html, shouldn't you be referencing firebase-messaging-sw.js and not firebase-message.js? Also, I believe firebase-messaging-sw.js needs to be at the root level (no nesting in script directory). Thus you would have something like the following in index.html...
<script src="firebase-messaging-sw.js">
The service worker script will be loaded and will then import the Firebase scripts from the Firebase CDN.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With