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 {
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,