P
P
Peter2020-08-26 14:28:09
JavaScript
Peter, 2020-08-26 14:28:09

Getting notifications in opera and mozilla?

I use FireBase

to keep track of notifications in the background

// Retrieve an instance of Firebase Messaging so that it can handle background
// messages.
const messaging = firebase.messaging();

messaging.setBackgroundMessageHandler(function(payload) {
  
    let options = {
        body: payload.data.body,
        icon: payload.data.icon
    }

    return self.registration.showNotification(payload.data.title, options);

});


The situation is the following, when I close the Chrome or Yandex browser, and send a notification to the browser launch field, the notification comes, but it doesn’t happen in Opera and Mozilla browsers, tell me, is this a feature of these particular browsers or do I need to tweak something?

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question