Created
September 6, 2020 19:01
-
-
Save MaBbKhawaja/f7b5f00b70b4f8c76f15c6161e7c88d8 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import * as firebase from 'firebase/app'; | |
import 'firebase/messaging' | |
// // Initialize Firebase | |
firebase.initializeApp({ | |
'messagingSenderId': '744798928283' | |
}); | |
navigator.serviceWorker.register('firebase-messaging-sw.js', {scope: "firebase-cloud-messaging-push-scope"}) | |
.then((registration) => { | |
const messaging = firebase.messaging(); | |
messaging.useServiceWorker(registration); | |
}).catch(err => { | |
console.log(err) | |
}) | |
// fiebase configs end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment