fixed double push notification message
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful

This commit is contained in:
Xeovalyte 2023-01-14 19:39:10 +01:00
parent 8bbf4016da
commit db55edffa4
3 changed files with 10 additions and 22 deletions

View File

@ -136,7 +136,8 @@ app.post('/sendmessage', async (req, res) => {
const message = { const message = {
notification: { notification: {
title: title, title: title,
body: body body: body,
icon: 'https://wrbapp.xeovalyte.com/ios/256.png',
}, },
topic: 'all', topic: 'all',
apns: { apns: {

View File

@ -4,6 +4,7 @@
"requires": true, "requires": true,
"packages": { "packages": {
"": { "": {
"name": "frontend",
"hasInstallScript": true, "hasInstallScript": true,
"dependencies": { "dependencies": {
"@capacitor/core": "^4.3.0", "@capacitor/core": "^4.3.0",
@ -6637,9 +6638,9 @@
"dev": true "dev": true
}, },
"node_modules/json5": { "node_modules/json5": {
"version": "2.2.1", "version": "2.2.3",
"resolved": "https://registry.npmjs.org/json5/-/json5-2.2.1.tgz", "resolved": "https://registry.npmjs.org/json5/-/json5-2.2.3.tgz",
"integrity": "sha512-1hqLFMSrGHRHxav9q9gNjJ5EXznIxGVO09xQRrwplcS8qs28pZ8s8hupZAmqDwZUmVZ2Qb2jnyPOWcDH8m8dlA==", "integrity": "sha512-XmOWe7eyHYH14cLdVPoyg+GOH3rYX++KpzrylJwSW98t3Nk+U8XOl8FWKOgwtzdb8lXGf6zYwDUzeHMWfxasyg==",
"bin": { "bin": {
"json5": "lib/cli.js" "json5": "lib/cli.js"
}, },
@ -16492,9 +16493,9 @@
"dev": true "dev": true
}, },
"json5": { "json5": {
"version": "2.2.1", "version": "2.2.3",
"resolved": "https://registry.npmjs.org/json5/-/json5-2.2.1.tgz", "resolved": "https://registry.npmjs.org/json5/-/json5-2.2.3.tgz",
"integrity": "sha512-1hqLFMSrGHRHxav9q9gNjJ5EXznIxGVO09xQRrwplcS8qs28pZ8s8hupZAmqDwZUmVZ2Qb2jnyPOWcDH8m8dlA==" "integrity": "sha512-XmOWe7eyHYH14cLdVPoyg+GOH3rYX++KpzrylJwSW98t3Nk+U8XOl8FWKOgwtzdb8lXGf6zYwDUzeHMWfxasyg=="
}, },
"jsonc-parser": { "jsonc-parser": {
"version": "3.2.0", "version": "3.2.0",

View File

@ -31,17 +31,3 @@ const firebaseConfig = {
const app = firebase.initializeApp(firebaseConfig); const app = firebase.initializeApp(firebaseConfig);
const messaging = firebase.messaging(); const messaging = firebase.messaging();
messaging.onBackgroundMessage((payload) => {
console.log('[firebase-messaging-sw.js] Received background message ', payload);
// Customize notification here
const notificationTitle = payload.notification.title;
const notificationOptions = {
body: payload.notification.body,
icon: '/ios/256.png'
};
self.registration.showNotification(notificationTitle,
notificationOptions);
});