firebase-realtime-database

When Firebase function ends in Swift

依然范特西╮ 提交于 2020-02-04 03:36:31
问题 I am using a Firebase in my app, it queries through a lot of users and gets the specific data that is needed, but when it starts querying - the rest of the function keep running too, instead of just querying so I can't understand when it ends. For example in this code: ref.observeEventType(.ChildAdded, withBlock: { snapshot in let user = snapshot.value!.objectForKey("User") let name = (user!["Name"])! as! String print("name") }) print("done") Let's say we have 3 users in the Firebase Database

Display Firebase database content in a FirebaseListAdapter

风流意气都作罢 提交于 2020-02-03 02:12:25
问题 I am currently experimenting with Firebase by creating a kind of small chat app. I am able to send data to the database reference, however I would expect it to be displayed thanks to the following code. However that is not the case, I was wondering if there was something wrong with the way I am using the adapter for my list. protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); if(FirebaseAuth.getInstance()

Display Firebase database content in a FirebaseListAdapter

雨燕双飞 提交于 2020-02-03 02:12:11
问题 I am currently experimenting with Firebase by creating a kind of small chat app. I am able to send data to the database reference, however I would expect it to be displayed thanks to the following code. However that is not the case, I was wondering if there was something wrong with the way I am using the adapter for my list. protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); if(FirebaseAuth.getInstance()

Delete file in cloud storage from cloud functions

孤者浪人 提交于 2020-02-03 02:08:25
问题 I'm trying to make a Google Cloud Function which deletes images linked to person object in Firebase realtime database.. But every time I'm getting "Error during request" error (without any specific error.code, it's just undefined).. Here is a function code: const functions = require('firebase-functions'); // The Firebase Admin SDK to access the Firebase Realtime Database. const admin = require('firebase-admin'); const gcs = require('@google-cloud/storage')({ projectId: "PROJ_ID", keyFilename:

Firebase insert with generated key

好久不见. 提交于 2020-02-02 23:39:08
问题 I have a root in firebase like in the I am trying to enable user to delete an item on list. But user can give up his decision. When user give up this decision, I want to insert the deleted item again in the database. But, I want to insert with old firebase generated key, because I am using firebase push keys. Is that a bad practice. How firebase generate these keys? Does it checks every key on db and generate a new one? Is that any possibility, that key marked as removed and generated later

Display data from Firebase database in a HTML page

醉酒当歌 提交于 2020-02-02 03:40:35
问题 I am new to Firebase and JS. I am trying to display some user information on a web-page that is stored in Firebase database. Data format is something as this image: Based on the image above : From the available nodes, UserData is the one that holds the name, email, assigned-id I don't require to show User1/User2/User3, they are unreadable such as HNpTPoCiAYMZsdfdsfDD3SDDSs555S3Bj6X35 . I just need the Values associated with Attr1 and Attr3 for all the users there exists. Now, I would like to

null pointer exception while retrieving from firebase [duplicate]

天大地大妈咪最大 提交于 2020-01-30 13:09:37
问题 This question already has answers here : What is a NullPointerException, and how do I fix it? (12 answers) Closed 16 days ago . Unable to fetch data from my database all permissions are public and dependencies included. I am trying to print data to logcat, receiving NullPointerException MainActivity.java import android.support.annotation.NonNull; import android.support.v7.app.AppCompatActivity; import android.os.Bundle; import android.util.Log; import com.google.firebase.database.DataSnapshot

Retrieve count data from Firebase like MySQL

谁说我不能喝 提交于 2020-01-30 12:06:10
问题 When trying to pull data from a MySQL database, I can do something like: SELECT * FROM users ORDER BY id WHERE vehicle = car That should get me all the users that drives a car and not show users that drives a motorcycle for instance. Is there something like this for Firebase? I can only retrieve specific data from one user? My firebase database is like this: user -> user info (name, age, vehicle etc..) I want to query every user that drives a car and display them in a row. How do I do that? I

Unable to simultaneously satisfy constraints error whats causing this?

时光毁灭记忆、已成空白 提交于 2020-01-30 11:53:28
问题 ca someone help me with this import UIKit import Firebase class aboutmeViewController: UIViewController , UITableViewDelegate,UITableViewDataSource { var refrelation : DatabaseReference! @IBOutlet weak var me: UITableView! var relationList = [aboutmeModel] () public func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int { return relationList.count } public func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell { let cell =

Firebase : Can't convert object of type java.lang.String to type com.example.g.Model.Cart

£可爱£侵袭症+ 提交于 2020-01-30 11:43:39
问题 I had error that said com.google.firebase.database.DatabaseException: Can't convert object of type java.lang.String to type com.example.g.Model.Cart at com.google.firebase.database.core.utilities.encoding.CustomClassMapper.convertBean(com.google.firebase:firebase-database@@16.0.5:423) at com.google.firebase.database.core.utilities.encoding.CustomClassMapper.deserializeToClass(com.google.firebase:firebase-database@@16.0.5:214) at com.google.firebase.database.core.utilities.encoding