last
This commit is contained in:
@@ -17,11 +17,11 @@ app.post("/send-notification", async (req, res) => {
|
|||||||
|
|
||||||
try {
|
try {
|
||||||
|
|
||||||
const { token, title, body, type, logo,id } = req.body;
|
const { token, title, body, logo, MediaType, TargetScreen } = req.body;
|
||||||
|
|
||||||
|
|
||||||
let message = {};
|
let message = {};
|
||||||
if (type === "text") {
|
if (MediaType === "text") {
|
||||||
|
|
||||||
message = {
|
message = {
|
||||||
notification: {
|
notification: {
|
||||||
@@ -32,15 +32,14 @@ app.post("/send-notification", async (req, res) => {
|
|||||||
title: title,
|
title: title,
|
||||||
body: body,
|
body: body,
|
||||||
temp_source: "text",
|
temp_source: "text",
|
||||||
route: "splaasa",
|
route: TargetScreen,
|
||||||
id: id,
|
|
||||||
},
|
},
|
||||||
token: token,
|
token: token,
|
||||||
};
|
};
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
else if (type === "image") {
|
else if (MediaType === "image") {
|
||||||
|
|
||||||
message = {
|
message = {
|
||||||
notification: {
|
notification: {
|
||||||
@@ -48,6 +47,12 @@ app.post("/send-notification", async (req, res) => {
|
|||||||
body: body,
|
body: body,
|
||||||
imageUrl: logo,
|
imageUrl: logo,
|
||||||
},
|
},
|
||||||
|
data: {
|
||||||
|
title: title,
|
||||||
|
body: body,
|
||||||
|
temp_source: "image",
|
||||||
|
route: TargetScreen,
|
||||||
|
},
|
||||||
android: {
|
android: {
|
||||||
notification: {
|
notification: {
|
||||||
imageUrl: logo,
|
imageUrl: logo,
|
||||||
|
|||||||
Reference in New Issue
Block a user