firebase-realtime-database

iOS - Firebase Filter query

流过昼夜 提交于 2020-01-21 06:14:06
问题 I got score node in Firebase: And under score node my data structure is as: { "jjTO29ziQ2SjrH5PFzY7ZMpSgjq1-Kak6FCyGtdy_kcEPd4K" = { jjTO29ziQ2SjrH5PFzY7ZMpSgjq1 = "-Kak6FCyGtdy_kcEPd4K"; score = 5; }; "jjTO29ziQ2SjrH5PFzY7ZMpSgjq1-KbE_pgfUsukOm4uW0bx" = { jjTO29ziQ2SjrH5PFzY7ZMpSgjq1 = "-KbE_pgfUsukOm4uW0bx"; score = 4; }; Question: Can I filter the data by score ? I tried doing : FIRDatabase.database().reference().child("scores").queryOrdered(byChild: "score").observeSingleEvent(of: .value,

iOS - Firebase Filter query

别等时光非礼了梦想. 提交于 2020-01-21 06:13:46
问题 I got score node in Firebase: And under score node my data structure is as: { "jjTO29ziQ2SjrH5PFzY7ZMpSgjq1-Kak6FCyGtdy_kcEPd4K" = { jjTO29ziQ2SjrH5PFzY7ZMpSgjq1 = "-Kak6FCyGtdy_kcEPd4K"; score = 5; }; "jjTO29ziQ2SjrH5PFzY7ZMpSgjq1-KbE_pgfUsukOm4uW0bx" = { jjTO29ziQ2SjrH5PFzY7ZMpSgjq1 = "-KbE_pgfUsukOm4uW0bx"; score = 4; }; Question: Can I filter the data by score ? I tried doing : FIRDatabase.database().reference().child("scores").queryOrdered(byChild: "score").observeSingleEvent(of: .value,

Cloud Functions for Firebase: can you detect app uninstall?

泄露秘密 提交于 2020-01-20 02:48:28
问题 Is it possible to trigger a Cloud Function when the user uninstalls the app, so that we can clean up the anonymous user realtime database entry? 回答1: You can detect app uninstall for Android as an automatically collected Analytics event called app_remove . Then you could trigger a Cloud Function to run when that event occurs. You would also need to use the Firebase Admin SDK to access the database. Check out some of the Cloud Functions for Firebase GitHub samples to see examples of using

How to rename nodes in Firebase from Unity

拥有回忆 提交于 2020-01-19 18:04:37
问题 I am using Firebase-Unity beta tool for real time data in my app. I want to change node names in the tree without override its children. For example: IFirebase firebase; firebase = Firebase.CreateNew ("https://test1.firebaseio.com/someChild"); firebase_Rank.Child("ChilOne").SetValue(1); firebase_Rank.Child("ChilTwo").SetValue(2); firebase_Rank.Child("ChilThree").SetValue(3); In this kind of tree is it possible to change the names of "ChildOne" without override it's value. 回答1: The Firebase

How to rename nodes in Firebase from Unity

做~自己de王妃 提交于 2020-01-19 18:03:25
问题 I am using Firebase-Unity beta tool for real time data in my app. I want to change node names in the tree without override its children. For example: IFirebase firebase; firebase = Firebase.CreateNew ("https://test1.firebaseio.com/someChild"); firebase_Rank.Child("ChilOne").SetValue(1); firebase_Rank.Child("ChilTwo").SetValue(2); firebase_Rank.Child("ChilThree").SetValue(3); In this kind of tree is it possible to change the names of "ChildOne" without override it's value. 回答1: The Firebase

How to get an email when new key is created in Firebase real time database

痞子三分冷 提交于 2020-01-17 17:27:33
问题 Well, I have looked almost everywhere, and apparently there is Firebase Cloud Functions which can be used to send me an email whenever a new key is created in my database. However, I cannot wrap my head around where to start and how to do it. Can someone help me please. 回答1: You can indeed use a Cloud Function to send an email each time a new node (i.e. a new key) is created in the database. Have a look at the documentation for Realtime Database triggers here and at one of the official Cloud

Unable to get All child data in Firebase Database using a Map?

为君一笑 提交于 2020-01-17 08:31:13
问题 I am trying to display all child "name" located in my database tree. My Database tree I used the Map to do so: GenericTypeIndicator<Map<String, Object>> m = new GenericTypeIndicator<Map<String, Object>>() {}; Map<String, Object> map = snapshot.getValue(m); String username = (String) map.get("name"); displayName.setText(username);// Display the name I am displaying all the data into a recyclerView. But for some reasons instead of getting all names(Eva, smith, princess), I am only one which is

Search for sub child in firebase database

≡放荡痞女 提交于 2020-01-17 08:19:09
问题 Firebase Structure Hi, I am try to work out how to query jobBrand & jobName in my Firebase Database (Structure Attached) and store it in a tableView. I am going to store more information under each Job Brand so I would like to keep the structure this way if possible? So far, I can get tableView to read the 2 fields if they are one level up, so the structure would be: tbaShootApp -> Jobs -> Job Brand > data. I cannot work out to query down another level and store it in the tableView. Is this

Retrieve from firebase to multiple buttons in swift 3

北慕城南 提交于 2020-01-17 07:35:19
问题 I am trying to retrieve data from firebase and display into multiple buttons and label. After retrieving i am saving it into a dictionary. This is my model import Foundation import Firebase class QuestionModel: NSObject { var CorrectAnswer: String! var Question: String! var optionA: String! var optionB: String! var optionC: String! init(snapshot: FIRDataSnapshot) { if let snapshotDict = snapshot.value as? Dictionary<String, Any> { CorrectAnswer = snapshotDict["CorrectAnswer"] as? String

How to retrieve data from firebase using Swift?

白昼怎懂夜的黑 提交于 2020-01-17 06:55:21
问题 I have this code for getting data from firebase database : FIRDatabase.database().reference().child("Root").child("User1").child("chat1") .observeSingleEvent(of: .value , with: { snapshot in if snapshot.exists() { let recent = snapshot.value as! NSDictionary print(recent) }) There is a problem with the result of snapshot, the print(recent) sometimes prints all values of that child (10 values) which is the thing I want, but some time it prints only two values of that child I don't know why.