google-cloud-functions

TypeError: Cannot read property 'get' of undefined at > ServerResponse.json?

我的梦境 提交于 2020-12-04 10:09:27
问题 I am getting the following errors when trying to make a simple cloud function which detects a like on the RD, and then ads posts to a user timeline. How can I fix the function? What am I doing wrong? (2 errors bellow are from the Firebase cloud functions console) 1. TypeError: Cannot read property 'get' of undefined at ServerResponse.json (/workspace/node_modules/express/lib/response.js:257:20) at ServerResponse.send (/workspace/node_modules/express/lib/response.js:158:21) at likerUIDRef.once

“Unexpected token stripe” when trying to deploy Firebase Functions

雨燕双飞 提交于 2020-11-30 00:29:53
问题 I'm trying to incorporate Stripe into an iOS app using Firebase Functions. I'm following the Stripe documentation for "Accepting a payment" in Swift with Node backend. I first did npm install --save stripe . That finished with no errors. Then I did npm install . My index.js looks like this so far: // // Create and Deploy Your First Cloud Functions // // https://firebase.google.com/docs/functions/write-firebase-functions // // exports.helloWorld = functions.https.onRequest((request, response)

“Unexpected token stripe” when trying to deploy Firebase Functions

。_饼干妹妹 提交于 2020-11-30 00:28:11
问题 I'm trying to incorporate Stripe into an iOS app using Firebase Functions. I'm following the Stripe documentation for "Accepting a payment" in Swift with Node backend. I first did npm install --save stripe . That finished with no errors. Then I did npm install . My index.js looks like this so far: // // Create and Deploy Your First Cloud Functions // // https://firebase.google.com/docs/functions/write-firebase-functions // // exports.helloWorld = functions.https.onRequest((request, response)

Cloud functions onUpdate: Cannot read property 'forEach' of undefined

五迷三道 提交于 2020-11-29 21:25:37
问题 Now I am trying to update the picture in my project. I could update the picture url in the cloud fire store. But also I want to delete the previous picture from the cloud storage using firebase cloud functions. What I want to achieve is, to delete the previous picture from the cloud storage when I upload the new picture. This is my data structure. I have "sample" field in "Product" collection. When the picture in "sample" field is updated, I want to delete the original picture in the cloud

Cloud functions onUpdate: Cannot read property 'forEach' of undefined

有些话、适合烂在心里 提交于 2020-11-29 21:16:23
问题 Now I am trying to update the picture in my project. I could update the picture url in the cloud fire store. But also I want to delete the previous picture from the cloud storage using firebase cloud functions. What I want to achieve is, to delete the previous picture from the cloud storage when I upload the new picture. This is my data structure. I have "sample" field in "Product" collection. When the picture in "sample" field is updated, I want to delete the original picture in the cloud

Cloud functions onUpdate: Cannot read property 'forEach' of undefined

社会主义新天地 提交于 2020-11-29 21:14:23
问题 Now I am trying to update the picture in my project. I could update the picture url in the cloud fire store. But also I want to delete the previous picture from the cloud storage using firebase cloud functions. What I want to achieve is, to delete the previous picture from the cloud storage when I upload the new picture. This is my data structure. I have "sample" field in "Product" collection. When the picture in "sample" field is updated, I want to delete the original picture in the cloud

How to invoke firebase Schedule functions locally using pubsub emulator

你。 提交于 2020-11-29 10:27:46
问题 I am working on cloud functions especially schedule functions. I need to trigger a function periodically each 5 minutes, but in only test step. I need to run it on pubsub emulator without deploying it. How to do it? I tried to use firebase shell, but it triggered only once exports.scheduledFunctionPlainEnglish =functions.pubsub.schedule('every 2 minutes') .onRun((context) => { functions.logger.log("this runs every 2 minutes") return null; }) 回答1: This is currently not supported for scheduled

How to trigger a cloud function in Firebase on password change?

☆樱花仙子☆ 提交于 2020-11-29 10:17:38
问题 I am trying to trigger a Firebase cloud function when a user changes their password, be it by changing the password (firebase.auth().currentUser. updatePassword(newPassword) ) or by reseting it (firebase.auth(). sendPasswordResetEmail(email) ). Since I am not storing password anywhere I can not use .onUpdate trigger (or any other of the triggers). I found a similar question, but it only asked about a trigger on password change and there is no info about a workaround: Firebase cloud function

Reading .cer files from jar file failing

人盡茶涼 提交于 2020-11-29 10:15:01
问题 I was trying to install client SSl cert at runtime. The certs are already packed with jar and is available in the below location While trying to read all available .cer files from the above mentioned path using below code ,it got failed String rootPath = this.getClass().getClassLoader().getResource("certs/"+activeProfile+"/").getPath(); File folder = new File(rootPath); File[] listOfFiles = folder.listFiles(); while debugging I am getting "rootPath" as "file:/workspace/mnb-123-no-data-flow

Reading .cer files from jar file failing

落爺英雄遲暮 提交于 2020-11-29 10:14:41
问题 I was trying to install client SSl cert at runtime. The certs are already packed with jar and is available in the below location While trying to read all available .cer files from the above mentioned path using below code ,it got failed String rootPath = this.getClass().getClassLoader().getResource("certs/"+activeProfile+"/").getPath(); File folder = new File(rootPath); File[] listOfFiles = folder.listFiles(); while debugging I am getting "rootPath" as "file:/workspace/mnb-123-no-data-flow