For this to work, we're doing the following:
- Importing using importScripts while considering this as the script tag with the src attribute in HTML, the firebase app, and the messaging libraries. Then, we're introducing our Firebase config object; we've already discussed where you can grab that object content in the past chapters.
- Initializing our Firebase app with our config file.
- Creating a new reference from the firebase.messaging library--always remember that everything in Firebase starts with a reference.
- We're listening to the install and activate events and printing some stdout friendly message to the browser debugger.
Also, within our manifest.json file, we're adding the following metadata:
- The application name (optional). ...