S
S
Sawa2021-03-30 14:52:37
Google
Sawa, 2021-03-30 14:52:37

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

1 answer(s)
S
Sawa, 2021-03-30
@dsdfsdf

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();
                }
            }
        });

But without this piece, sending does not work at all
And the issue of late notifications from firebase has not been resolved

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question