FCM integration in React js

Jagannath Swarnkar
1 min readOct 14, 2020

--

<script src="https://www.gstatic.com/firebasejs/7.19.1/firebase-app.js"></script><script src="https://www.gstatic.com/firebasejs/7.19.1/firebase-analytics.js"></script><!-- Add Firebase products that you want to use --><script src="https://www.gstatic.com/firebasejs/7.19.1/firebase-auth.js"></script><script src="https://www.gstatic.com/firebasejs/7.19.1/firebase-firestore.js"></script><script src="https://www.gstatic.com/firebasejs/7.18.0/firebase-messaging.js"></script><script>// TODO: Replace the following with your app's Firebase project configurationvar firebaseConfig = {
apiKey: "AIzaSyCHXXva9....xxxxxxxxxx",
authDomain: "xxxxxx.firebaseapp.com",
databaseURL: "https://xxxxxxx.firebaseio.com",
projectId: "XXXXXX",
storageBucket: "xxxxxx.appspot.com",
messagingSenderId: "329736xxxxxx",
appId: "1:32973xxxxx:web:8bc5c0776fxxxxxxxx",
measurementId: "G-LK8JXXXXX"
};
// Initialize Firebasefirebase.initializeApp(firebaseConfig);const messaging = firebase.messaging()messaging.onMessage((payload) => {
console.log('Message received. ', payload);
});
</script>

--

--

Jagannath Swarnkar
Jagannath Swarnkar

Written by Jagannath Swarnkar

Sr. Software Engineer | React js | Next js | Node Js | Flutter

No responses yet