I am trying to return a set of values in a Firebase cloud onCall function, but when I read the value in my Android app, part of the data is missing.
Here is the cloud function:
exports.getPhotoUrls = functions.https.onCall(async (data, context) => {
let usersAndPhotos = new Map();
usersAndPhotos.set("bob", "2345");
usersAndPhotos.set("sam", "345");
const returnVal = {
payload: usersAndPhotos,
status: 200,
message: "Success"
}
console.log("ReturnVal: " );
console.log(returnVal)
return returnVal
})
When I check in the Firebase functions log, I see that the returned value is:
{ payload: Map { 'bob' => '2345', 'sam' => '345' },
status: 200,
message: 'Success' }
However, when the function returns to my Android app, the payload Map is missing:
Why is my payload Map data disappearing?
