google-cloud-functions

Firebase emulator return empty data whereas working fine after deploying

こ雲淡風輕ζ 提交于 2020-05-15 08:06:59
问题 I have a written a very basic API which will return the services. I tried to run this API in emulator but it return the empty data { "status": "success", "statusCode": 200, "message": "Services retrieved", "data": [] } I have setup the firestore, functions and database emulators. And I am using "firebase-admin": "^8.10.0", "firebase-functions": "^3.6.0" Any idea why the data response is empty ? EDIT This is my method to call the service export const activeServices = functions.https.onRequest(

How to get documents in firestore, whose document IDs are stored in the list?, i.e bring only those documents…?

99封情书 提交于 2020-05-15 07:52:09
问题 I have a list that contains the document Ids of a particular collection "users", and I want to get documents only present in this list, and these documents are in "users" collection as mention before. Code: getUsers() async { double radius = 0.3; String field = "GeoPosition"; print(currentUser.point.longitude); GeoFirePoint center = geo.point(latitude: currentUser.point.latitude, longitude: currentUser.point.longitude); var collectionRef = Firestore.instance.collection('user_locations')

Firebase-Admin package Typescript error in Cloud Functions Firestore : @types/googlemaps

会有一股神秘感。 提交于 2020-05-15 05:49:21
问题 I have two projects with similar Cloud Functions setup, both directly using Typescript setup (no Webpack) similar to this example or this one One of them uses Firestore, other one doesn't. The one that does not use Firestore compiles and deploys with no error. However the one with Firestore functions gives me this error on tsc compile: ../node_modules/@types/googlemaps/index.d.ts(33,29): error TS2304: Cannot find name 'Element'. ../node_modules/@types/googlemaps/index.d.ts(37,19): error

Google Cloud - Egress IP / NAT / Proxy for google cloud functions

久未见 提交于 2020-05-15 05:42:05
问题 I'm building a data ingestion layer for my company where I have a lot of different integration points (rest apis). Some of the API's require you to connect from a whitelisted IP. I'd really like to use google cloud functions / pubsub to build the ingestion logic because of it's scalability and reduced cost. But the problem is that google cloud functions always connect from random ips and there is nothing we can do about that, as is answered in this question: Possible to get static IP address

Google Cloud - Egress IP / NAT / Proxy for google cloud functions

眉间皱痕 提交于 2020-05-15 05:42:05
问题 I'm building a data ingestion layer for my company where I have a lot of different integration points (rest apis). Some of the API's require you to connect from a whitelisted IP. I'd really like to use google cloud functions / pubsub to build the ingestion logic because of it's scalability and reduced cost. But the problem is that google cloud functions always connect from random ips and there is nothing we can do about that, as is answered in this question: Possible to get static IP address

Google Cloud - Egress IP / NAT / Proxy for google cloud functions

无人久伴 提交于 2020-05-15 05:41:07
问题 I'm building a data ingestion layer for my company where I have a lot of different integration points (rest apis). Some of the API's require you to connect from a whitelisted IP. I'd really like to use google cloud functions / pubsub to build the ingestion logic because of it's scalability and reduced cost. But the problem is that google cloud functions always connect from random ips and there is nothing we can do about that, as is answered in this question: Possible to get static IP address

How to verify custom Firebase Auth Token, created by createCustomToken()

半腔热情 提交于 2020-05-15 04:59:28
问题 I created custom Auth Token via createCustomToken(), see https://firebase.google.com/docs/auth/admin/create-custom-tokens. But later on when I try to verify this token via verifyIdToken() function it throws following error Error: verifyIdToken() expects an ID token, but was given a custom token. See https://firebase.google.com/docs/auth/admin/verify-id-tokens for details on how to retrieve an ID token. Which is rational, because there is no such ID... But what I need - is to simply verify the

Firebase cloud function server side global variables

别等时光非礼了梦想. 提交于 2020-05-15 04:14:40
问题 It's possible to have a sort of a global variable on firebase cloud functions? I mean I could have an index.js like that in which set-up a global variable, let's say panicModeVariable . And I would like to check in my cloud functions this variable before doing anything, like here in the auth create user trigger. const functions = require('firebase-functions'); const admin = require("firebase-admin"); admin.initializeApp(functions.config().firebase); var globalVariable = false; // Create

Firebase cloud function server side global variables

為{幸葍}努か 提交于 2020-05-15 04:14:18
问题 It's possible to have a sort of a global variable on firebase cloud functions? I mean I could have an index.js like that in which set-up a global variable, let's say panicModeVariable . And I would like to check in my cloud functions this variable before doing anything, like here in the auth create user trigger. const functions = require('firebase-functions'); const admin = require("firebase-admin"); admin.initializeApp(functions.config().firebase); var globalVariable = false; // Create

Firebase cloud function onCall not working after changing region

混江龙づ霸主 提交于 2020-05-14 21:37:24
问题 I built few cloud functions like this one: const addRoom = functions.https.onCall((data, context) => { It works perfectly but I wanted to change region to europe-west. I followed this stackoverflow: firebase deploy to custom region (eu-central1) const addRoom = functions.region('europe-west1').https.onCall((data, context) => { It looks working fine for all functions (triggers) except onCall functions . I got this error when calling addRoom function on client side : firebase.functions()