send test push notifications to specific users only
This commit is contained in:
@ -114,7 +114,7 @@ const Notification = async (req, res) => {
|
|||||||
}
|
}
|
||||||
else if (id) {
|
else if (id) {
|
||||||
console.log('Sending push notification to publisher ', id)
|
console.log('Sending push notification to publisher ', id)
|
||||||
await sendPush(id, title, message.actions)
|
await sendPush(id, title, message, actions)
|
||||||
res.statusCode = 200
|
res.statusCode = 200
|
||||||
res.end()
|
res.end()
|
||||||
return
|
return
|
||||||
|
@ -833,7 +833,20 @@ export default function CalendarPage({ initialEvents, initialShifts }) {
|
|||||||
headers: {
|
headers: {
|
||||||
'Content-Type': 'application/json'
|
'Content-Type': 'application/json'
|
||||||
},
|
},
|
||||||
body: JSON.stringify({ broadcast: true, message: "Тестово съобщение", title: "Това е тестово съобщение от https://sofia.mwitnessing.com" })
|
body: JSON.stringify({
|
||||||
|
id: pub.id, message: "Тестово съобщение", title: "Това е тестово съобщение от https://sofia.mwitnessing.com", actions: [
|
||||||
|
{
|
||||||
|
action: 'open_url',
|
||||||
|
title: 'Open URL',
|
||||||
|
icon: '/images/open-url.png'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
action: 'dismiss',
|
||||||
|
title: 'Dismiss',
|
||||||
|
icon: '/images/dismiss.png'
|
||||||
|
}
|
||||||
|
]
|
||||||
|
})
|
||||||
})
|
})
|
||||||
}}
|
}}
|
||||||
>+</button>
|
>+</button>
|
||||||
|
@ -108,7 +108,7 @@ export default function DashboardPage({ initialItems, initialUserId, cartEvents,
|
|||||||
toast(content, {
|
toast(content, {
|
||||||
toastId,
|
toastId,
|
||||||
autoClose: false, // Keep the toast open until manually closed
|
autoClose: false, // Keep the toast open until manually closed
|
||||||
closeButton: true,
|
closeButton: false,
|
||||||
onClose: () => handleClose(toastId),
|
onClose: () => handleClose(toastId),
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
Reference in New Issue
Block a user