Web Push at Mapp is based on Firebase.
The Service Worker is necessary to display messages when the browser or tab are not in focus.
Download the JavaScript file firebase-messaging-sw.js.
Create the Webapp-Project in Firebase and copy the configuration.
In the JavaScript file "firebase-messaging-sw.js" make the following adjustments by pasting the configuration:
Example/* ... */ const firebaseConfig = { apiKey: "<<Firebase apiKey>>", authDomain: "<<Firebase authDomain>>", projectId: "<<Firebase projectId>>", storageBucket: "<<Firebase storageBucket>>", messagingSenderId: "<<Firebase messagingSenderId>>", appId: "<<Firebase appId>>", measurementId: "<<Firebase measurementId>>" }; /* ... */Parameter
Description
apiKey
Please include as specified in your firebase console in project settings > general > my app > configuration.
authDomain
projectId
storageBucket
messagingSenderId
appId
measurementId
Watch the following video for more details:
Include the script file "firebase-messaging-sw.js" on your server.