How to get parameters from request in cloud functions? Firebase
For Web: (POST Request)
We have:
export const myFunction = functions.https.onRequest((req, res) => {
const conversationID = req.body.conversationID;
const currentUserID = req.body.currentUserID;
return ;
});
Ref : Firestore Read From Values
I read this post and rewrote my code so it works for me.
const functions = require('firebase-functions');
const admin = require('firebase-admin');
module.exports = functions.https.onRequest((req, res) => {
const conversationID = req.query.conversationID;
const currentUserID = req.query.currentUserID;
console.log("conversationID", conversationID, "currentUserID", currentUserID);
return console.log("getChatGroupConversationAvatars");
});