WebPush with Firebase (FCM) push delay
预算 $10-30 USD
Hi, a weird thing is happening to me with FCM - Firebase Messaging Cloud. In android I have no problem with notifications, they arrive immediately or in 1 or 2 seconds, but in web with javascript, sometimes the payload (data) or notifications do not arrive ... but at first it works, I emit data from my server in Node and they arrive immediately, I keep doing it every minute and in the foreground and I keep receiving the payloads, but if I stop sending notifications in more than 3 minutes and send, they arrive with an indefinite delay, sometimes half an hour ... Very rare, when I send notifications in a row (1 minute approx) there is no problem, but if I do it every 5 minutes or more they come with a delay ...
In my server:
const message = {
data: {
title: "Some title...",
body: "Some content...",
info: "some data...",
},
webpush: {
headers: {
Urgency: "high",
TTL: "4500"
},
},
tokens: tokens,
};
[login to view URL]
.sendMulticast(message)
.then((response) => {
[login to view URL]("Sent...", response);
})
.catch((error) => {
[login to view URL](error);
});
In my javascript client:
async created() {
[login to view URL]({
vapidKey: 'BMvK2Y2H_........'
}).then((currentToken) => {
if (currentToken) {
[login to view URL](currentToken)
this.$[login to view URL]("[login to view URL]", {
token: currentToken
})
.then(response => {
[login to view URL](response)
}).catch((error) => {
[login to view URL](error)
});
} else {
// Show permission request UI
[login to view URL]('No registration token available. Request permission to generate one.');
// ...
}
}).catch((err) => {
[login to view URL]('An error occurred while retrieving token. ', err);
// ...
});
},
mounted() {
[login to view URL]((payload) => {
[login to view URL]('Message received. ', payload);
});
}
有2名威客正在参与此工作的竞标,均价$28/小时
Hello, Hope this message finds you well, I checked your details and I believe that my experience is what you are looking 4. I have been working on similar projects for the past eight years, and I have the essential sk 更多