WIP Firebase Changes for messaging
This commit is contained in:
@@ -54,6 +54,8 @@ const messaging = firebase.messaging();
|
|||||||
// // ...
|
// // ...
|
||||||
// });
|
// });
|
||||||
|
|
||||||
|
self.addEventListener('fetch',() => console.log("fetch"));
|
||||||
|
|
||||||
messaging.setBackgroundMessageHandler(function (payload) {
|
messaging.setBackgroundMessageHandler(function (payload) {
|
||||||
console.log(
|
console.log(
|
||||||
"**********[firebase-messaging-sw.js] Received background message ",
|
"**********[firebase-messaging-sw.js] Received background message ",
|
||||||
|
|||||||
@@ -77,9 +77,12 @@ exports.receive = (req, res) => {
|
|||||||
notification: {
|
notification: {
|
||||||
title: `New SMS From ${phone(req.body.From)[0]}`,
|
title: `New SMS From ${phone(req.body.From)[0]}`,
|
||||||
body: req.body.Body,
|
body: req.body.Body,
|
||||||
|
click_action: "TEST CLICK ACTION",
|
||||||
},
|
},
|
||||||
data: {
|
data: {
|
||||||
jobid: "1234",
|
jobid: "1234",
|
||||||
|
title: `New SMS From ${phone(req.body.From)[0]}`,
|
||||||
|
body: req.body.Body,
|
||||||
},
|
},
|
||||||
tokens: uniqueTokens,
|
tokens: uniqueTokens,
|
||||||
};
|
};
|
||||||
@@ -92,7 +95,7 @@ exports.receive = (req, res) => {
|
|||||||
.then((response) => {
|
.then((response) => {
|
||||||
// Response is a message ID string.
|
// Response is a message ID string.
|
||||||
console.log(
|
console.log(
|
||||||
"[SMS Receive] Successfully sent FCM Broadcast.:",
|
"[SMS Receive] Successfully sent FCM Broadcast.:"
|
||||||
//JSON.stringify(response)
|
//JSON.stringify(response)
|
||||||
);
|
);
|
||||||
})
|
})
|
||||||
@@ -160,6 +163,5 @@ exports.receive = (req, res) => {
|
|||||||
// [0] ApiVersion: '2010-04-01'
|
// [0] ApiVersion: '2010-04-01'
|
||||||
// [0] }
|
// [0] }
|
||||||
|
|
||||||
|
|
||||||
// [0] MediaContentType0: 'image/jpeg',
|
// [0] MediaContentType0: 'image/jpeg',
|
||||||
// MediaContentType0: 'video/3gpp',
|
// MediaContentType0: 'video/3gpp',
|
||||||
|
|||||||
Reference in New Issue
Block a user