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) {
|
||||
console.log(
|
||||
"**********[firebase-messaging-sw.js] Received background message ",
|
||||
|
||||
@@ -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',
|
||||
|
||||
Reference in New Issue
Block a user