google-cloud-functions

Add Custom user Property through firebase function

柔情痞子 提交于 2021-02-11 12:33:14
问题 Currently in our realtime database, we have a planDetails node for each uid that has fields like startDate , endDate , planType . I want to track the number of users whose premium plan is active. I am trying to do this by making a firebase function that runs daily and updates a boolean custom user property, say isPremiumActive , to either true or false. I cannot just track the users who have purchased the premium plan because there are many who take the plan once and then don't renew it.

Error: memory limit exceeded when 17%-21% is used, according to psutils

非 Y 不嫁゛ 提交于 2021-02-11 12:33:11
问题 I am deploying a Cloud Function with some intensive computing, using the following requirements: requirements.txt google-cloud-storage google-cloud-datastore numpy==1.16.2 pandas==0.24.2 scikit-image==0.16.1 psutil memory-profiler==0.55.0 scikit-learn==0.20.3 opencv-python==4.0.0.21 I have set the following arguments for deployment: [--memory: "2147483648", --runtime: "python37", --timeout: "540", --trigger-http: "True", --verbosity: "debug"] As the function iterates processing frames, the

Firebase Functions throw function with internal error [closed]

橙三吉。 提交于 2021-02-11 12:22:37
问题 Closed. This question needs debugging details. It is not currently accepting answers. Want to improve this question? Update the question so it's on-topic for Stack Overflow. Closed 4 months ago . Improve this question I am developing a project under Firebase Hosting with Firebase Functions. Index.js: exports.simpleFunction = functions.https.onCall((data, context) => { return data; }); Index.html: var simpleFunction = firebase.functions().httpsCallable('simpleFunction'); simpleFunction("12")

Firebase cloud function http request crashing

╄→尐↘猪︶ㄣ 提交于 2021-02-11 12:14:06
问题 I'm trying to send expo push notification via firebase cloud functions, in order to send notifications from the web app to devices that have downloaded the mobile app. When I send the request from Postman, it works just fine... i get the ok response and the notification shows up on my phone. But when I try to make the request from the web app, i get this in the functions log: Function execution took 22 ms, finished with status: 'crash' Any ideas why is this happening? Couldn't find anything

How to send notification to multiple device token using firebase cloud functions

筅森魡賤 提交于 2021-02-11 12:11:51
问题 I am new in using Firebase Cloud Functions and JavaScript and I was able to send notification to a single device using Firebase Cloud Functions(JavaScript). Now I am trying to send push notification to multiple device token and I think I have a problem on it. I want to send the notification to these device tokens in my firebase database: /receivers /event1 /uid1: device_token1 /uid2: device_token2 /uid3: device_token3 /uid4: device_token4 This is my code so far but it doesn't work.. exports

How to send notification to multiple device token using firebase cloud functions

烂漫一生 提交于 2021-02-11 12:10:12
问题 I am new in using Firebase Cloud Functions and JavaScript and I was able to send notification to a single device using Firebase Cloud Functions(JavaScript). Now I am trying to send push notification to multiple device token and I think I have a problem on it. I want to send the notification to these device tokens in my firebase database: /receivers /event1 /uid1: device_token1 /uid2: device_token2 /uid3: device_token3 /uid4: device_token4 This is my code so far but it doesn't work.. exports

Generate JWT in Google cloud function - python

陌路散爱 提交于 2021-02-11 09:42:17
问题 I wrote a script and uploaded it to GCFunctions. Now, one of my functions is using PyJWT library in order to generate JWT for GCP API calls, the problem is that I keep getting errors every time I run the function. When I added pyjwt to 'requirements.txt' I got the error: 'Algorithm RS256 could not be found', then I tried to add cryptography (the encrypting library that pyjwt uses), and also tried pycrypto (for RS256 registering) but still nothing. I'd be grateful for some help here! even

Generate JWT in Google cloud function - python

筅森魡賤 提交于 2021-02-11 09:39:09
问题 I wrote a script and uploaded it to GCFunctions. Now, one of my functions is using PyJWT library in order to generate JWT for GCP API calls, the problem is that I keep getting errors every time I run the function. When I added pyjwt to 'requirements.txt' I got the error: 'Algorithm RS256 could not be found', then I tried to add cryptography (the encrypting library that pyjwt uses), and also tried pycrypto (for RS256 registering) but still nothing. I'd be grateful for some help here! even

Firebase Cloud Functions execution time is so fluctuate

限于喜欢 提交于 2021-02-11 08:09:17
问题 I got this from google cloud console. I don't understand why after the function is executed, it should turn hot for some duration. However, after deploying the function and call it, I found cold start and then drop to actual and then increase to cold start again. Please help! // index.js import * as functions from 'firebase-functions' import express from 'express' import cors from 'cors' import auth from 'controllers/auth' const authApp = express() authApp.use(cors({ origin: true })) authApp

Firebase Cloud Functions execution time is so fluctuate

帅比萌擦擦* 提交于 2021-02-11 08:08:08
问题 I got this from google cloud console. I don't understand why after the function is executed, it should turn hot for some duration. However, after deploying the function and call it, I found cold start and then drop to actual and then increase to cold start again. Please help! // index.js import * as functions from 'firebase-functions' import express from 'express' import cors from 'cors' import auth from 'controllers/auth' const authApp = express() authApp.use(cors({ origin: true })) authApp