I am trying to call a parameterized cloud function deployed from FlutterFlow to Firebase Cloud Functions. This function has only one input parameter, which is of type string
, and its return type is also string
. I am calling this function from a FlutterFlow action and passing the parameter to it.
However, when I pass a string input to the cloud function—which has logic to simply take the input and return it as is—it returns null
. On the other hand, when I return a hardcoded value, it works fine.
The return value is displayed on a page state variable.
Below is the function:
const functions = require('firebase-functions');
const admin = require('firebase-admin');
// To avoid deployment errors, do not call admin.initializeApp() in your code
exports.newCloudFunction = functions.https.onCall(
(data, context) => {
const inputparameter = data.inputparameter;
// Write your code below!
// Write your code above!
return inputparameter;
}
);