This commit is contained in:
Gitea
2026-05-13 12:10:46 +05:30
parent c2643e3521
commit 55c7f7d693
+10 -5
View File
@@ -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,