From 55c7f7d693d01c10c1f6a3e2bd7ca4439640685d Mon Sep 17 00:00:00 2001 From: Gitea Date: Wed, 13 May 2026 12:10:46 +0530 Subject: [PATCH] last --- index.js | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) 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,