google-cloud-functions

Firebase Cloud Functions - Stripe Connect Webhook not firing

落爺英雄遲暮 提交于 2021-02-05 11:43:31
问题 I'm trying to set up my stripe webhooks to fire invoking a firebase cloud function automatically whenever a Stripe Connect account is created, updated, or anything at this point. It only fires if I manually go to the Stripe Dashboard > Webhooks and hit the "send test webhook button". so far what I've done: 1) created a Stripe Connect Webhook: 2) set up Webhook endpoint with firebase URL 3) set up node.js Firebase Cloud function to fire whenever stripe's webhook pings the Firebase URL. const

How to schedule a firebase function, in limited times

穿精又带淫゛_ 提交于 2021-02-05 10:40:14
问题 I have a firebase function that should be ran every 1 hour, but only for X times. I scheduled it in this way : functions.pubsub.schedule('every 1 hour').onRun((context) => { let counter = // read last counter value from db counter++; if(counter === X) return; // save counter in db // my job } But this method is not optimal, because the scheduler is always active, even when it's not required. Do you offer a better method for this purpose? 回答1: What you're trying to do isn't supported by

Firebase Cloud Functions without Cloud Storage

戏子无情 提交于 2021-02-05 08:40:38
问题 I am not sure how technical this question is, but posting it here to request help from firebase / google cloud experts can help me. I have started with cloud functions in Aug 2020 and was able to successfully deploy cloud functions and test without the need for cloud storage. But yesterday I observed that on Sep 17th, 2020, 2 buckets were created in cloud storage and I have been billed for these buckets. There was no change in the way I deployed the cloud functions nor was there any change

Firebase, how to send mass push notifications at once using Cloud Functions

孤街醉人 提交于 2021-02-05 08:35:51
问题 I'm a Swift dev and I'm not a backend dev. This is actually 3 different questions in bold below but they all are dependent upon each other. Any stack overflow answers to similar questions would be enough to get me started @followers | kim_userId // kimKardashian -userId_0: 1 -... // every user in between -userId_188_million: 1 Right now I'm using a very inefficient way to send a mass push notification: @IBAction func postButtonTapped(button: UIButton) { let postsRef = Database.database()

Firebase, how to send mass push notifications at once using Cloud Functions

回眸只為那壹抹淺笑 提交于 2021-02-05 08:33:51
问题 I'm a Swift dev and I'm not a backend dev. This is actually 3 different questions in bold below but they all are dependent upon each other. Any stack overflow answers to similar questions would be enough to get me started @followers | kim_userId // kimKardashian -userId_0: 1 -... // every user in between -userId_188_million: 1 Right now I'm using a very inefficient way to send a mass push notification: @IBAction func postButtonTapped(button: UIButton) { let postsRef = Database.database()

Error on setting Environment variables in Google Cloud using the SDK

只谈情不闲聊 提交于 2021-02-05 08:23:27
问题 I am trying to set up Environment Variables for my Django app on Google Cloud. I entered the following on the SDK: gcloud functions deploy env_vars --runtime python37 --set-env-vars SUBSCRIPTION_KEY=1234567890 --trigger-http The error returned was: ERROR: (gcloud.functions.deploy) OperationError: code=3, message=Build failed: {"error": {"canonicalCode": "INTERNAL", "errorMessage": "`pip_install_from_wheels` had stderr output:\n/opt/python3.7/bin/python3.7: No module named pip\n\nerror: `pip

Should firebase auth onCreate trigger have more data?

血红的双手。 提交于 2021-02-05 08:19:28
问题 I'm using functions.auth.user().onCreate() as part of a firestore project, and trying to set up some default data when a new user registers. For the front end, I'm using firebase-ui, with Google and Email/Password providers enabled. When I sign in with an email and password, the UI widget prompts to enter a name and set a password. I was expecting to see the name as part of the user parameter in the onCreate() function call, but I'm getting practically nothing: user: { email: 'xxx@yyyy.co.uk'

request(…).then is not a function error when making a POST request

橙三吉。 提交于 2021-02-05 07:46:16
问题 I'm trying to create a firebase function that makes a HTTP POST request whenever a new document is created. This is my code: import * as functions from 'firebase-functions'; const admin = require('firebase-admin'); const request = require("request"); exports.sendMessage = functions.firestore.document('comms/{comms}').onCreate((snap, context) => { const newValue = snap.data(); if (newValue) { //const email = newValue.email; const msg = newValue.msg; return request({ uri: "url", method: 'POST',

how to return a 204 response code in firebase hosting (node.js)

≯℡__Kan透↙ 提交于 2021-02-05 07:24:25
问题 Need some help. I am trying to access a file on firebase hosting with an android application, the application is downloading a .txt file and for verification reasons, before starting the download, it should check if the server is reachable, it needs a 204 response code (no content). I can do it in PHP like so: (https://www.yourserver.com/return204.php): <? php http_response_code(204); ?> I found this link, but its looks very complicated: Firebase HTTP Functions, compared to the PHP solution.

Firebase Google Cloud Function: createReadStream results in empty file

故事扮演 提交于 2021-02-05 07:17:13
问题 I try to process a Video file (stored in Google Firebase storage) through a Google Cloud Function. I have working code that download the entire video files into the NodeJS Google cloud function: await bucket.file(filePath).download({ destination: tempFile }) . But the goal is only to read the framerate, therefore the headers of the videofile would suffice. But createReadStream gives me an empty tempFile. Any advise much appreciated! exports.checkFramerate = functions.region('europe-west1')