diff --git a/index.js b/index.js index 0dfc211..0ce3a4b 100644 --- a/index.js +++ b/index.js @@ -17,11 +17,11 @@ app.post("/send-notification", async (req, res) => { try { - const { token, title, body, type, logo,id } = req.body; + const { token, title, body, logo, MediaType, TargetScreen } = req.body; let message = {}; - if (type === "text") { + if (MediaType === "text") { message = { notification: { @@ -32,15 +32,14 @@ app.post("/send-notification", async (req, res) => { title: title, body: body, temp_source: "text", - route: "splaasa", - id: id, + route: TargetScreen, }, token: token, }; } - else if (type === "image") { + else if (MediaType === "image") { message = { notification: { @@ -48,6 +47,12 @@ app.post("/send-notification", async (req, res) => { body: body, imageUrl: logo, }, + data: { + title: title, + body: body, + temp_source: "image", + route: TargetScreen, + }, android: { notification: { imageUrl: logo,