Commit b179009d authored by axet's avatar axet 🍄

fix functions send topics

parent e7084d4a
......@@ -43,9 +43,11 @@ exports.topics = functions.https.onRequest((req, res) => {
message = JSON.parse(req.body);
break;
}
if (!message)
return;
admin.messaging().send(message);
if (message) {
let to = message.to.replace(/^(\/topics\/)/,'');
res = admin.messaging().sendToTopic(to, message);
}
res.send(`OK`);
});
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment