Answer the question
In order to leave comments, you need to log in
Why does Firebase Cloud Messaging send after some interval?
Salute to all!
For some reason, Firebase Cloud Messaging started sending notifications not instantly, sometimes after an hour it comes.
Whoever faced this?
Another 1 cant started sending 2 notifications at a time:
First: normal
Second empty, with the following content:
Background Message Title
Background Message Body
Answer the question
In order to leave comments, you need to log in
This is why notifications are duplicated
messaging.onMessage(function (payload) {
console.log(payload);
const notificationOption={
body:payload.notification.body,
icon:payload.notification.icon
};
if(Notification.permission === "granted"){
var notification = new Notification(payload.notification.title,notificationOption);
notification.onclick=function (ev) {
ev.preventDefault();
window.open(payload.notification.click_action,'_blank');
notification.close();
}
}
});
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question