firebase-realtime-database

How to use multiple orederbychild in Firebase database?

拟墨画扇 提交于 2019-12-23 06:20:06
问题 Hello Everyone I am using firebase database in my app. I am able to add data to database. Now I want to implement search in my app, I have two option for search users, 1)Blood Group 2)User Area I am able to get data as per blood group selection, but I don't know how can I fetch data with blood group and area. (Multiple Selection Filter) Now if the user will select 'A+' as blood group from spinner and select Area 'ABC' Then result would come as Users with 'A+' blood group and 'ABC' area.

How paginate with Firebase Database?

こ雲淡風輕ζ 提交于 2019-12-23 05:42:25
问题 I am trying to query firebase database in order to load more messages in a JSQMessagesViewController. When viewDidLoad is initialized, I make a query using childAdded and get the most recent 5 messages. Thereafter, in didTapLoadEarlierMessagesButton I call prepareToObserveOnce method. Its purpose is to observe a single event of type value and get 5 more messages which are older than the ones that were downloaded earlier. The problem is that when prepareToObserveOnce is called, the messages

Remove anonymous user from Auth database

[亡魂溺海] 提交于 2019-12-23 05:37:05
问题 I'm using Firebase database and little confused with next situation. Let's imagine i have todo app. I use standard Firebase Auth system for sync items between user devices. But in other case user could work anonymously without synchronization. Step 1: User launch app first time, and in AppDelegate i created Anonymous user: FIRAuth.auth()?.addStateDidChangeListener { auth, user in if let _user = user { if _user.isAnonymous { print("User logged in as anonymous. Saving uid to user defaults

Firebase RecylcerView Adapter Not Getting Accurate View Position

不打扰是莪最后的温柔 提交于 2019-12-23 05:34:09
问题 I am using the Firebase UI and am experiencing a unique issue. When I load the RecyclerView, there are no issues. I click an item on the RecyclerView and get the .push() value of the item that was clicked. It then takes data from that Firebase .push() value, which is stored in the Firebase database, and sends it to another activity. See images below: The second image is the activity that receives data via an intent. When I click back to the RecyclerView, I click "8" again and I am loading a

Just how persistent are Firebase database observers?

僤鯓⒐⒋嵵緔 提交于 2019-12-23 05:31:05
问题 I decided to run a test on the XCode iOS simulator to see if an observer to a location in the Firebase database would continue to fire even when the app is in the background. Turns out it does, but I am wondering if this is indefinite until the app terminates or if it will actually stop after some time. It's been a very long time and the observers still fires whenever I manually update the value in the database that the observer is looking at. Also note that I don't have any background modes

How to remove a child node after a certain date is passed in Firebase cloud functions?

末鹿安然 提交于 2019-12-23 05:24:18
问题 So i have a database structure where i save an event with a timestamp value that dictates when the event will expire and be removed so i created a firebase cloud function where i compare the time now (Date().now) with the timestamp in the database the problem is when the code gets run the event gets removed immediately here is the code: // // Create and Deploy Your First Cloud Functions // // https://firebase.google.com/docs/functions/write-firebase-functions // // exports.helloWorld =

Firebase - Retrieve User Information from Database

人走茶凉 提交于 2019-12-23 05:23:42
问题 > I have 3 classes. DriverDatabase.class AddInfoDriver.class DriverProfile.class In DriverDatabase.class I have set(fName, lName .... and other fields.). Also, put {get; and set;} for those attribtues. In AddInfoDriver.class I have referenced FirebaseDatabase and DriverDatabase.class so that, whenever a user fills those edittexts, it saves to Firebase Database. The Problem is: I cannot retrieve those 5 Edittext values in DriverProfile.class below is the piece of code for retrieving. public

Firebase Database Rules for Unique Usernames

喜欢而已 提交于 2019-12-23 05:13:51
问题 I'm trying to create a website that uses Firebase's databases to store user information. I want to use unique usernames. I have two indexes, one for users and another for usernames. My database is structured like this: users { $uid { username: "username1", gender: "xyz" email: "xyz" } }, usernames { "username1": $uid" } The users claim a username with their $uid. These are my rules: { "rules": { "users": { "$uid": { ".write": "auth !== null && auth.uid === $uid", ".read": "auth !== null &&

Firebase remove snapshot children swift

北战南征 提交于 2019-12-23 05:11:42
问题 I am using Firebase as my Database... Then i want to delete the "codigo" key value. This is my if statement: let profile = FIRDatabase.database().reference().child("barcodes") profile.observeEventType(.Value, withBlock: { (snapshot) -> Void in for item in snapshot.children { if item.value["codigo"]as! String == barcodes[indexPath.row].code{ print("HERE") item.removeValue!() } } but it crashes at item.removeValue() . 回答1: You cannot remove a snapshot. But you can get the reference that the

update UI after two async operations

馋奶兔 提交于 2019-12-23 05:09:09
问题 I am using google Firebase database in android. I need two fetch two set of data from database - userInfo and assignmentInfo. Then I need to combine them and show the data in a recycler view. What is the best way to approach this? As the fetching of data is async, this is getting messy. One way i can think of is, check in both async functions success if other has completed. If so, get its data, combine and initialize the adapter. Is this the best way do this? 回答1: I have solved this kind of