Questions tagged [firebase-cloud-functions]

Use this tag for questions related to Cloud Functions for Firebase.

Cloud Functions for Firebase is a hosted, private, and scalable Node.js environment where you can run JavaScript code in response to database and other events including HTTPS requests. You simply create reactive functions that trigger whenever an event occurs. Cloud Functions for Firebase is built on top of Google Cloud Functions.

13 questions
39
votes
9 answers

how to test Cloud Functions for Firebase locally on pc

Today Firebase released its brand new product Cloud Functions for Firebase and I just created a hello world function and deploy it on my existing firebase project. It looks like it bundles all dependencies and upload it to firebase just like aws…
31
votes
3 answers

How to make an HTTP request in Cloud Functions for Firebase?

I am trying to make a call to apples receipt verification server using Cloud Functions for Firebase. Any idea how to make an HTTP call?
13
votes
1 answer

Access db data in Cloud Functions for Firebase

In Cloud Functions for Firebase, for example: exports.makeUppercase = functions.database.ref('/messages/{pushId}/original') .onWrite(event => { //how to access data at another node, for example //important/messages/{pushId} }) How to…
4
votes
1 answer

How to implement json object in Cloud Functions for Firebase?

I want to verify apple in app purchase receipt by sending the original receipt to App store server for validation and get validated receipt back, using Firebase cloud functions. var jsonObject = { 'receipt-data': receiptData, …
4
votes
2 answers

Storing Image Using Cloud Functions for Firebase

I'm trying to refactor some code to use Cloud Functions for Firebase. The code should store an image at a path in Firebase storage. For the most part the code is the exact same as before except now instead of server.post('/', (req, res) => { //…
4
votes
1 answer

How can I use nodemailer with Cloud Functions for Firebase?

I'm trying to use nodemailer in a Cloud Functions for Firebase but keep getting errors seeming to be that the smpt server cant be reached or found. Iv'e tried gmail, outlook and a normal hosted smpt service. It works well from my local node…
3
votes
1 answer

HTTP request to a google service returns Error: read ECONNRESET firebase cloud functions

I am trying to translate the name of a user from english to an indian language using google translate api and storing the data back in realtime database with a cloud function. This function is invoked by a write to the database, and I am using a…
2
votes
1 answer

Why is this Cloud Function called more than once with an Android HTTP request trigger?

I have a function in an Android app which sends a POST request to an HTTP triggered Cloud Function. Whenever I click the button once to send the message, Firebase registers the event twice on the Firebase console. My application is built in such a…
1
vote
1 answer

Firebase Cloud Function onWrite trigger firing multiple times

I'm creating a contact form on my website that writes to a Real-time Database. Using Cloud Functions, I want to respond to the database entry by sending myself an email with that contacts details. I've confirmed that I am only sending the payload…
1
vote
2 answers

firebase express cloud functions cors errors

I've been trying like crazy to get this firebase http function to work with cors. Basically, I am serving the admin sdk locally to verify if a certain user token has admin claims to it. The token is sent via a get request as a parameter in the url.…
1
vote
1 answer

Firebase Cloud Functions to send an HTTP request on a user sign-in trigger?

I'm sorry, but I've watched all seven of Jennifer Person's videos, read the documentation, and worked through the tutorials but I still don't see how to write my function. I'm trying to write a function that gets an IBM Watson Speech-to-text token,…
1
vote
1 answer

Cloud Functions for Firebase HTTP Request

I want to send an HTTP Request from Android to a cloud function, post some values, then input these values into real time database. index.js const functions = require('firebase-functions'); exports.testPost = functions.https.onRequest((req, res)…
0
votes
0 answers

Can I use Firebase Cloud Functions for Scheduling Task?

I'm making simple mobile app using react-native. it's server check some http resource every minute. If the changes exist, it send push notifications to user. In this situation, can I use Google Cloud Functions (Cloud Functions for Firebase) as a…