Quantcast
Channel: Ionic Forum - Latest topics
Viewing all articles
Browse latest Browse all 70439

PWA firebase push : messaging.onMessage never called

$
0
0

@vgoesi06 wrote:

Hi alls,
I have an ionic 4 angular PWA project and want to use firebase cloud messaging.
Registration with firebase is ok aénd I can get token my problem that messaging.onMessage never called and the notification catched by OS

this my firebase-messagin-sw.js

importScripts('https://www.gstatic.com/firebasejs/7.12.0/firebase-app.js');
importScripts('https://www.gstatic.com/firebasejs/7.12.0/firebase-messaging.js');

const messaging = firebase.messaging();

messaging.setBackgroundMessageHandler(function(payload) {
  
    const notificationTitle = 'Background Message Title';
    const notificationOptions = {
      body: 'Test ' + JSON.stringify(payload),
      
    };
  
    return self.registration.showNotification(notificationTitle,
      notificationOptions);
});

other staff is made in my notification service

Any idea ?

Posts: 1

Participants: 1

Read full topic


Viewing all articles
Browse latest Browse all 70439

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>