firebase-realtime-database

Swift Firebase sort by last 10 and then show 10 new values

末鹿安然 提交于 2020-01-17 05:41:27
问题 I am currently having trouble with displaying values through my tableview, as I am creating this Instagram/Facebook-like feed, where the tableView updates at the bottom(simply fetches new value from the database through firebase). However, I am really struggling with populating the tableView with non-dulpicate data. I am currently sorting my firebase ref by child (timestamp), and by default I display the "queryLimitedToLast(10)". However, here comes the problem. I can't really find a way to

Firebase equalto dynamic nested child

ⅰ亾dé卋堺 提交于 2020-01-17 05:34:06
问题 With a structure of /archive: { $userId: { $archiveKey: { foo: 1 }, ... }, ... } Where $userId references a user id and $archiveKey is dynamic, created by .push() . Is it possible to query the archive ref and get all archiveObjects where foo = 1 ? Or do I need to fetch down the whole table, manually dig into $userId and extract the archiveObjects I'm looking for? 回答1: Firebase queries can nowadays query nested paths, but the paths cannot be dynamic. So if you know the uid, you can query that

How to bypass unique ID and retrieve multiple auto generated child

只谈情不闲聊 提交于 2020-01-17 04:14:06
问题 I want to retrieve multiple child with an auto generated child(Estab_url child). Here is my Code. All i can retrieve is one child and its random final DatabaseReference establishments = database.getReference("establishments"); establishments.child(s2).child("Estab_url").addChildEventListener(new ChildEventListener() { @Override public void onChildAdded(DataSnapshot dataSnapshot, String s) { if (dataSnapshot.hasChildren()) { // String value = dataSnapshot.getValue(String.class); String sd =

Updating label if value in singleton changes

爱⌒轻易说出口 提交于 2020-01-17 03:16:08
问题 I am getting some user information from Firebase and storing it into singleton. After that every time the value changes I want that the label changes also but it doesn't until I terminate the app and come back in. How should I update label if value changes in singleton? I have tab views. In first tab I assign values and in second tab I try to put the values to label. This is my singleton: class CurrentUser: NSObject { var generalDetails: User = User()/// Consecutive declarations on a line

Connect two random users from Database

孤者浪人 提交于 2020-01-17 01:36:25
问题 I’m trying to create an app where I need to match two random users from my Firebase Database. The problem I have is that I‘m not sure how to connect every user of the database to random pairs: As far as I thought the user might press a button to signal that he‘s ready, so a child of his UID like 'searching' turns from false to true. By receiving a DataSnapshot the user can see if another user is searching too. Then I thought of turning the 'searching' state to false for both users and create

How to add data from Firebase to DataGridView using FireSharp

不羁岁月 提交于 2020-01-17 00:38:50
问题 I just want to retrieve data from a Firebase to DataGridView. The code I have is retrieving data already, however, it's retrieving everything to the same row instead of creating a new one. I'm a beginner in coding, so I really need help with that. I read online that Firebase doesn't "Count" data, so it'd be needed to create a counter, so each time I add or delete data, an update would be needed. I did it and it's working. I created a method to load the data. private async Task firebaseData()

How to query the existing children of a sibling node and loop over them to detect if it exists?

十年热恋 提交于 2020-01-16 20:55:30
问题 I am trying to update (adding) new children on a firebase database. On this scenario I am updating two nodes and_"door/{MACaddress_1}/ins"_ & _"doors/{MACaddress_2}/ins"_ and both of this nodes need to write through a Google Cloud function to a sibling node called "rooms/{roomPushKey}/ins" . I will be updating the initial "doors" nodes through an Arduino program on a IoT device with a unique MAC Address that is connecting to the database to the '/doors/' + {MAC Address} + '/ins'. These are

How to add links in every data of my list?

℡╲_俬逩灬. 提交于 2020-01-16 19:42:20
问题 After creating new classroom, the data will then be send to a list as shown on the IMG 1: Now, how do I add/make (a) link/s into every classroom so that whenever I click it it will redirect me to a page and show me their specific data like ClassroomID, students, etc. here's the code: //retrieving var userRef = firebase.database().ref().child('Classes' + '/' + user.uid); userRef.on('child_added', function(data) { var roomNames = data.val().TheClass; var ul = document.createElement('ul');

Error to load item with RecyclerView

本秂侑毒 提交于 2020-01-16 19:42:07
问题 I know that RecyclerView loads the items again every time to save memory and increase performance. However, I found a problem with the images, that is that when I start to scroll quickly the recyclerView the elements start to recharge in the wrong order. I put the video in description of what happens. How can I resolve this error? LINK: https://www.youtube.com/watch?v=iwHUYgWIm5g RecyclerViewAdapter.class package com.example.mattiaferigutti.chatjava; import android.content.Context; import

How to store data in Firebase along with Authentication data

我怕爱的太早我们不能终老 提交于 2020-01-16 19:34:08
问题 I have integrated Firebase Authentication with Android App. Now I have to store other app related data like user extended profile, user preferences, settings etc. According to Firebase documentation, Realtime database can be used to save any data. Is this the correct approach or is there any other way in firebase to store data? If this is the correct approach, what database name should I use here? I meant where to create the database in Firebase? FirebaseDatabase database = FirebaseDatabase