Why am I not receiving bombing reports?

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) }) // Call to user messaging.onMessage(function(payload) { console.log('firebase', payload) if(payload.data.status == 'calling') { this.audio.play() this.$store.commit(types.CALLING, JSON.decode(payload.data.order)) } }) 

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"}) } }) 
+8
javascript firebase firebase-cloud-messaging
source share

No one has answered this question yet.

See related questions:

3915
Why does Google add while (1); in your JSON answers?
1693
Why is using a "for ... in" with array iteration a bad idea?
1511
Why ++ [[]] [+ []] + [+ []] returns the string "10"?
8
Firebase service worker not found when using GWT (404 error)
one
Firebase quickstart-js / messaging: Firefox push notification issue
one
Firebase messaging returns success but webapp does not receive message
one
Firebase Messaging getToken () does nothing / Chrome Extension Background
0
Unable to receive messages using firebase messages in browser
0
Firebase Cloud Messaging Messages / Credential Mismatch
-one
Notification received by firebase

All Articles