WIP Firebase Changes for messaging

This commit is contained in:
Patrick Fic
2020-07-22 12:46:40 -07:00
parent 4abef35822
commit 8005a5c1f1
2 changed files with 6 additions and 2 deletions

View File

@@ -54,6 +54,8 @@ const messaging = firebase.messaging();
// // ...
// });
self.addEventListener('fetch',() => console.log("fetch"));
messaging.setBackgroundMessageHandler(function (payload) {
console.log(
"**********[firebase-messaging-sw.js] Received background message ",

View File

@@ -77,9 +77,12 @@ exports.receive = (req, res) => {
notification: {
title: `New SMS From ${phone(req.body.From)[0]}`,
body: req.body.Body,
click_action: "TEST CLICK ACTION",
},
data: {
jobid: "1234",
title: `New SMS From ${phone(req.body.From)[0]}`,
body: req.body.Body,
},
tokens: uniqueTokens,
};
@@ -92,7 +95,7 @@ exports.receive = (req, res) => {
.then((response) => {
// Response is a message ID string.
console.log(
"[SMS Receive] Successfully sent FCM Broadcast.:",
"[SMS Receive] Successfully sent FCM Broadcast.:"
//JSON.stringify(response)
);
})
@@ -160,6 +163,5 @@ exports.receive = (req, res) => {
// [0] ApiVersion: '2010-04-01'
// [0] }
// [0] MediaContentType0: 'image/jpeg',
// MediaContentType0: 'video/3gpp',