I'm exporting a Firebase cloud function that I can call from my iOS app.
exports.myFunction = functions.https.onCall((someData, context) => {
});
How do I call an async function?
exports.myFunction = functions.https.onCall((someData, context) => {
return await someAsyncFunction();
});
The documentation states to return a promise but I'm not sure how to wrap an existing async function into a promise that I can return.
https://firebase.google.com/docs/functions/callable
To return data after an asynchronous operation, return a promise. The data returned by the promise is sent back to the client. For example, you could return sanitized text that the callable function wrote to the Realtime Database: