I see that my server correctly sends Firebase API messages, since it returns a success: 1 response, but my client does not receive messages, what is happening, my code:
const messaging = firebase.messaging() const that = this messaging.requestPermission() .then(function() { return messaging.getToken() }) .then(function(token) { that.updateServerFirebaseToken(token) }) .catch(function(err) { console.log(err) })
and my firebase-messaging-sw.js service worker
const messaging = firebase.messaging() messaging.setBackgroundMessageHandler(function(payload) { console.log('FIREBASE call', payload); if(payload.data.status == 'calling') { channel.postMessage(payload.data) return self.registration.showNotification('Nuevo pedido', {body: "Llamada para transporte de un pedido"}) } })
javascript firebase firebase-cloud-messaging
Boris Barroso
source share