google-cloud-functions

Firebase Cloud Functions for Firestore are not triggering

五迷三道 提交于 2021-02-10 06:34:48
问题 Cannot get Firebase Cloud Functions for Firestore to trigger on onWrite of my collection. Trying to setup device to device push notification for chat app. Function is deployed and on Pay as you go plan, however, changes in document, updates or create in "chats" collection is not triggering. Firebase cloud messaging is supposed to send a push and write to the log. Neither is happening. Push is working with other sources. Thanks for your help, wish device to device push notifications was easier

Firebase Cloud Functions for Firestore are not triggering

一笑奈何 提交于 2021-02-10 06:34:26
问题 Cannot get Firebase Cloud Functions for Firestore to trigger on onWrite of my collection. Trying to setup device to device push notification for chat app. Function is deployed and on Pay as you go plan, however, changes in document, updates or create in "chats" collection is not triggering. Firebase cloud messaging is supposed to send a push and write to the log. Neither is happening. Push is working with other sources. Thanks for your help, wish device to device push notifications was easier

How to schedule jobs for python code in Firebase?

我的梦境 提交于 2021-02-10 06:22:13
问题 I want to make my code run once a day in firebase server. The code is using some pulling data out of HTTP libraries as beautiful soup. I could not find appropriate result after some search. Can you give me instructions how to do it? Thanks in advance 回答1: You could have a look to function-cron which allows you to schedule cron jobs in Firebase . Google App Engine provides a Cron service. Using this service for scheduling and Google Cloud Pub/Sub for distributed messaging, you can build an

Firebase onCreate add custom claims to the auth.user

人盡茶涼 提交于 2021-02-10 06:07:01
问题 I am trying to add a custom claims, isRegistered to firebase. My firestore has another user collection to keep register info records. Now I am trying to keep a isRegistered custom claim but I can not seem to get it work. exports.addRegisteredRole = functions.database.ref('/user') .onCreate((snap, context) => { return // **I added this later, but the issue still remains.** admin.auth() .setCustomUserClaims(context.auth.uid, {isRegistered: true}) .then(() => { console.log('done', snap) return {

Call cloud functions without waiting for response

这一生的挚爱 提交于 2021-02-10 05:59:27
问题 Trying a little hack here with cloud functions but can't seem to figure out what the issue is. I'm currently using now.sh to host serverless functions and would like to call 1 function from another. Lets say I have 2 functions declared fetchData & setData . When the setData function is called it processes some data and then calls the fetchData function. export const setData = async (req: Request, res: Response) => { await axios.post( fetchDataEndpointUrl, { params: { key, }, }, ); return res

Generating thumbnails with Cloud Functions using the Python37 runtime

筅森魡賤 提交于 2021-02-10 04:21:55
问题 I have a Google Cloud Function triggered by Firebase Storage, and I want to generate thumbnails. While the Node.js docs have an example that uses ImageMagick there is no such equivalent for the python runtime. What would be an acceptable approach keeping performance in mind ? Would Pillow-SIMD work in a cloud function ? Or should I go App Engine for thumbnail generation and use the Images service ? 回答1: You can use wand, a binding to ImageMagick, along with google-cloud-storage to resize an

passing path parameter in google endpoints to backend not working

跟風遠走 提交于 2021-02-08 20:52:59
问题 My setup contains google-endpoints with google-cloud-functions as my backend. Google endpoints is defined with the following swagger v2 yaml: swagger: "2.0" info: description: "yada..." version: "0.0.1" title: "yadada.." termsOfService: "http://swagger.io/terms/" contact: name: "blah" email: "email@mail.com" url: "https://example.com" host: "(generated service url by google when endpoints is deployed, i.e. 'api-gateway-xyz123123-ew.a.run.app')" tags: - name: "Documents" description: "blah"

passing path parameter in google endpoints to backend not working

余生颓废 提交于 2021-02-08 20:52:21
问题 My setup contains google-endpoints with google-cloud-functions as my backend. Google endpoints is defined with the following swagger v2 yaml: swagger: "2.0" info: description: "yada..." version: "0.0.1" title: "yadada.." termsOfService: "http://swagger.io/terms/" contact: name: "blah" email: "email@mail.com" url: "https://example.com" host: "(generated service url by google when endpoints is deployed, i.e. 'api-gateway-xyz123123-ew.a.run.app')" tags: - name: "Documents" description: "blah"

How to import firebase-functions and firebase-admin in ES6 syntax for transpiling with Babel for Node 10

回眸只為那壹抹淺笑 提交于 2021-02-08 19:02:07
问题 I'm currently writing my cloud functions in ES6 and transpiling with Babel to target the Node v10 environment. And I've noticed something weird. Why is that when I import firebase-functions like this: import functions from 'firebase-functions'; I get this error: ! TypeError: Cannot read property 'https' of undefined at Object.<anonymous> (C:\myProject\functions\index.js:28:55) And to fix it, I need to import it like this: import * as functions from 'firebase-functions'; While the following

How to get Crashlytics event from BigQuery[Firebase project]

非 Y 不嫁゛ 提交于 2021-02-08 11:40:21
问题 We have enabled BigQuery feature for our Firebase project , since last week firebase team announced that Crashlytics is moved from Beta to Prod release , so I was thinking this data should be available in BigQuery in some form. But I was not able to see any Crash event in my BigQuery table even the app crashed a couple of time. So does anybody know how to extract the crashlytics report from Firebase for custom reporting solution. 回答1: Crashlytics data is not currently available in BigQuery