firebase-realtime-database

I want to take the currentUser's userId and add it as a child to all their friend's data- in Firebase with Swift

雨燕双飞 提交于 2020-01-06 06:57:20
问题 In my Firebase database, the parent data is all the users' userId s. They each have a child("friends") which contains a list of all their friends' userId s. I want to get each currentUser 's friends' userId s and add the currentUser 's userId to each of their friends' child("closeFriends") node This is how my data structure looks: users 10XeC8j6OCcFTKj8Dm7lR7dVnkf1 email: "Dummy19@gmail.com" fcmToken: "cBW9XhpYqio:APA91bF6K5YgRj0PgyDCoApNpIWGO4icwFg..." friends ekFjYJU8OWTbYnQXVzhcxVE0wBP2:

Firebase orderByChild return the first time an array, the second time an objec

一笑奈何 提交于 2020-01-06 06:41:48
问题 I have the following database on firebase : { "pops" : [ { "description" : "22", "number" : "13", "serie" : "0", "title" : "luke skywalker [jedi]" }, { "description" : "Test", "number" : "55", "serie" : "2", "title" : "Bilbo" }, { "description" : "le second porteur d'anneau", "number" : "13", "serie" : "2", "title" : "Frodon" }], "series" : [ { "description" : "La grande saga des étoiles", "title" : "Star Wars" }, { "description" : "L'autre grande saga des étoiles", "title" : "Star Trek" }, {

Database fetch exists only in its own function

狂风中的少年 提交于 2020-01-06 06:18:38
问题 I am trying to fetch all the user names in my database but the nameArray only contains values while its inside that function, how can I fix this? DataService.instance.getAllUserNamesPlease { (returnedNamesArray) in self.nameArray = returnedNamesArray } for userName in nameArray { if(userName.lowercased() == name!.lowercased()){ self.userNameTaken = true self.progressView.progress = Float(progress / self.nameArray.count) progress += 1/self.nameArray.count break } } nameArray is empty in this

Firebase Database suddenly returning nil

巧了我就是萌 提交于 2020-01-06 06:10:00
问题 Up until two days ago my code was working fine with no problems, out of the blue my code begins returning nil when I know for a fact that the value is there within my Firebase node. I have not touched the code in weeks nor have made anychanges to it any time recently. I have recently upgraded my Xcode to 9 but still running Swift 3. I have the value radiusDistanceNumber declared above my viewDidLoad() as class viewController: UIViewController { var radiusDistanceNumber: Int() override func

Login and Reading/Writing Data in Android Studio, No Error but Not Working

烂漫一生 提交于 2020-01-06 06:08:19
问题 I have run into a problem, where there are no errors, both in the logs and the android monitor. However when I click login it doesn't work nothing happens at all. By the way I'm making an app that uses firebase database, and I'm on the Login and Dispalying User Details part. Perhaps something is wrong with my Login? or in my display? Here's my code: Login: package com.loginpack; import... public class LoginActivity extends AppCompatActivity { //VIEW AND WIDGETS Button loginBtn; EditText

Firebase value is undefined when it is not supposed to be

狂风中的少年 提交于 2020-01-06 06:06:45
问题 I am working on a firebase project. During testing the return user.val().name; will return an undefined value however the console.log(user.val().name) will return the actual string stored in the .name field. Why is that. Also even if assign the user.val().name to a variable, the variable remains undefined.Please help figure out why this happens. I am printing it to a csv. Here is my code: var database = firebase.database(); var ref2 = database.ref('information/'); var id; var name; ref2.on(

How to convert Vue.js realtime chat app from Realtime Database to Firestore

╄→гoц情女王★ 提交于 2020-01-06 06:02:25
问题 I am attempting to build a realtime chatroom app with Vue.js and Firebase, based directly on the following tutorial: https://www.djamware.com/post/5d63586ee8e5fff670f31169/vuejs-tutorial-building-firebase-realtime-chat-web-app. This tutorial uses Firebase Realtime Database for managing chats in dynamically-created chatrooms. My goal is to fully convert the app from Realtime Database to Firestore. I have so far been successful in implementing firebase.get() and firebase.add() methods in the

Firebase Database. Retrieve nested data

冷暖自知 提交于 2020-01-06 06:02:05
问题 MY CURRENT CODES (now its working) @Override protected void onStart() { super.onStart(); petshopRef.addValueEventListener(new ValueEventListener() { @Override public void onDataChange(DataSnapshot dataSnapshot) { petshopsList.clear(); for (DataSnapshot postSnapshot : dataSnapshot.getChildren()) { Petshops petshops = postSnapshot.getValue(Petshops.class); petshopsList.add(petshops); } CustomerPetshopAdapter adapter = new CustomerPetshopAdapter(CustomerViewPetshopActivity.this, R.layout

Retrieve a list with angularFire and more than one child

走远了吗. 提交于 2020-01-06 05:53:49
问题 I'm using angularFire to connect my page to my database. I want to display all the users stored in my firebase database in the form of a list on a page. The way I am storing these users is like this : users |_date1 | |_hour1 | |_email:name |_date2 | |_hour2 | |_email:name |... if I use the method below, I can only get one "subsection", not the other children... this.fireDB.list('users').snapshotChanges().subscribe(res => { res.forEach(doc => { this.credentialsArray.push(doc.key, doc.payload

Display target data from firebase

╄→尐↘猪︶ㄣ 提交于 2020-01-06 05:51:35
问题 I display a list of my targets in fragmentA , when I click on one of them, I pass the guid of this target to the fragmentB After that, I try in the fragmentB display the data of this target for this guid: private fun fetchTarget(guid: String) { val uid = firebaseUser!!.uid // Attach a listener to read the data at the target id databaseReference?.child("targets")?.child("users") ?.child(uid)?.child("targets")?.child(guid)?.addValueEventListener(object : ValueEventListener { override fun