google-cloud-firestore

how to make get request firebase cloud functions

眉间皱痕 提交于 2020-01-16 18:45:28
问题 I am developing an app and I want to send my user coordinate from firestore to locationiq.com to get details and then write it in firestore I am using firebase cloud function to make GET request but I think it fails can someone help me with the code I am getting this error Function returned undefined, expected Promise or value const functions = require('firebase-functions'); const request = require('request'); const admin = require ('firebase-admin'); admin.initializeApp(); // Create and

Having a promise issue with my google cloud function

旧城冷巷雨未停 提交于 2020-01-16 18:01:05
问题 I have an http trigger in cloud functions that is working, however I am getting some logs come back in a weird order. I am pretty sure I have not executed the promises correctly. here is the code: exports.createGame = functions.https.onRequest((req, res) => { return cors(req, res, () => { // Check for POST request if (req.method !== "POST") { res.status(400).send('Please send a POST request'); return; } const createGame = admin.firestore().collection('games') generatePin() function

Error Running Gradle - gradlew.bat exited abnormally (Error after adding firebase)

空扰寡人 提交于 2020-01-16 18:00:50
问题 I am trying to read the firestore database. I have: * Registered My app on firebase . * copied googleservices.json in the app directory. * copied the dependencies as firebase instructed. Flutter Doctor Upgrading Flutter from C:\flutter... fa174a123..f31fc1bd0 master -> origin/master * [new branch] revert-34243-flutter_frame_event -> origin/revert-34243-flutter_frame_event Updating b593f5167..7a4c33425 11 files changed, 488 insertions(+), 83 deletions(-) Upgrading engine... Flutter 1.5.4

Flutter firestore listen is interrupting by previous page firestore listen

谁说胖子不能爱 提交于 2020-01-16 17:17:34
问题 I am developing an app with firestore. In my app main screen i am calling firestore listener in initState() . when i am going next screen (Screen B) then the previous screen (main screen) initState() function executing and interrupting listeners in screen B. I am not calling main screen initState() in Screen B. Why it showing ? Below shown as the code. class MainScreen extends StatelessWidget { MainScreen({Key key}): super(key: key); //The title want to My App @override Widget build

Flutter firestore listen is interrupting by previous page firestore listen

|▌冷眼眸甩不掉的悲伤 提交于 2020-01-16 17:15:54
问题 I am developing an app with firestore. In my app main screen i am calling firestore listener in initState() . when i am going next screen (Screen B) then the previous screen (main screen) initState() function executing and interrupting listeners in screen B. I am not calling main screen initState() in Screen B. Why it showing ? Below shown as the code. class MainScreen extends StatelessWidget { MainScreen({Key key}): super(key: key); //The title want to My App @override Widget build

Flutter firestore listen is interrupting by previous page firestore listen

若如初见. 提交于 2020-01-16 17:15:26
问题 I am developing an app with firestore. In my app main screen i am calling firestore listener in initState() . when i am going next screen (Screen B) then the previous screen (main screen) initState() function executing and interrupting listeners in screen B. I am not calling main screen initState() in Screen B. Why it showing ? Below shown as the code. class MainScreen extends StatelessWidget { MainScreen({Key key}): super(key: key); //The title want to My App @override Widget build

Can a query be constructed using a list of strings that represent a field in a firestore document?

爱⌒轻易说出口 提交于 2020-01-16 16:57:12
问题 I wish to filter documents based on a list which contains userId's these userId's are fields in the documents I wish to access. this question is similar but instead of a list of document references I have a list of field items. Currently all I have is a display of all the documents in the collection: Query posts = db.collection("posts"); FirestoreRecyclerOptions<Post> options = new FirestoreRecyclerOptions.Builder<Post>() .setQuery(posts, Post.class) .build(); adapter = new

Result of call to 'functionName()' is unused

雨燕双飞 提交于 2020-01-16 15:53:30
问题 I have an odd issue and I’m not sure what I am doing wrong. I have the following function that I want called in viewDidLoad to load all documents in a collection that will be used in a tableview. func functionName() -> [String] { var NameArray = [String]() db.collection("Names").getDocuments() { (querySnapshot, err) in if let err = err { print("Error getting documents: \(err)") } else { for document in querySnapshot!.documents { NameArray.append("\(document.documentID)") } } } print(NameArray

Result of call to 'functionName()' is unused

旧城冷巷雨未停 提交于 2020-01-16 15:53:13
问题 I have an odd issue and I’m not sure what I am doing wrong. I have the following function that I want called in viewDidLoad to load all documents in a collection that will be used in a tableview. func functionName() -> [String] { var NameArray = [String]() db.collection("Names").getDocuments() { (querySnapshot, err) in if let err = err { print("Error getting documents: \(err)") } else { for document in querySnapshot!.documents { NameArray.append("\(document.documentID)") } } } print(NameArray

Firebase/Node/React How to copy files from one firebase project to another?

坚强是说给别人听的谎言 提交于 2020-01-16 15:42:12
问题 I have a two Firebase projects using Storage to store files and Firestore for metadata. One project is for Staging and the other is for Production. I have a simple react app setup for uploading my files and metadata to the Staging project. I'm trying to figure out how to sync the Staging Storage and Firestores to the Production project. I haven't had much luck with google searches or the Firebase documentation (beyond seeing that you can connect to multiple firebase projects using node). Any