Moved firebase messaging notification handling to messaging generation.
This commit is contained in:
@@ -28,24 +28,26 @@ exports.testResponse = async (req, res) => {
|
||||
body: "Test Body",
|
||||
},
|
||||
tokens: uniqueTokens,
|
||||
android: {
|
||||
notification: {
|
||||
body: "This is an FCM notification specifically for android.",
|
||||
title: "FCM Notification for Android",
|
||||
//image: "url-to-image",
|
||||
},
|
||||
},
|
||||
// android: {
|
||||
// notification: {
|
||||
// body: "This is an FCM notification specifically for android.",
|
||||
// title: "FCM Notification for Android",
|
||||
// image: "/logo192.png",
|
||||
// badge: "/logo192.png",
|
||||
// },
|
||||
// },
|
||||
webpush: {
|
||||
headers: {
|
||||
// Urgency: "high",
|
||||
},
|
||||
notification: {
|
||||
body: "This is a message from FCM to web",
|
||||
// requireInteraction: "true",
|
||||
// actions: [{ action: "the action - matched in sw", title: "title" }],
|
||||
requireInteraction: "true",
|
||||
actions: [{ action: "the action - matched in sw", title: "Read" }],
|
||||
|
||||
// renotify: true,
|
||||
//tag: "1234",
|
||||
//tag: "1234", image: "/logo192.png",
|
||||
badge: "/logo240.png",
|
||||
//badge: "/badge-icon.png",
|
||||
},
|
||||
},
|
||||
|
||||
@@ -75,9 +75,9 @@ exports.receive = (req, res) => {
|
||||
const uniqueTokens = [...new Set(allTokens)];
|
||||
var message = {
|
||||
notification: {
|
||||
title: `New SMS From ${phone(req.body.From)[0]}`,
|
||||
title: `SMS - ${phone(req.body.From)[0]}`,
|
||||
body: req.body.Body,
|
||||
//click_action: "TEST CLICK ACTION",
|
||||
click_action: "TEST CLICK ACTION",
|
||||
},
|
||||
data: {
|
||||
jobid: "1234",
|
||||
|
||||
Reference in New Issue
Block a user