firebase-realtime-database

Firebase 3 get list which contain generated keys to ionic list

最后都变了- 提交于 2019-12-24 07:05:39
问题 I wanna synchronize firebase table with ionic list. These are items on database Items -KQpA9YpXyqBQ2HZedEo name: "jhj" -KQpAWtIaMeS93431BRQ name: "hj" -KQpB6grRt15GnacKHjW name: "j" This is ionic part <ion-list> <ion-item ng-repeat="item in items"> <h2>{{item.name}}</h2> </ion-item> </ion-list> Here is my firebase part var itemsRef = firebase.database().ref('Items'); //first try var items = itemsRef.orderByChild('name'); $scope.items = items; //this is second try itemsRef.on('child_added',

firebase databasereference gives no virtual method error

泪湿孤枕 提交于 2019-12-24 07:00:09
问题 I am trying to add firebase database some info by getting database reference but it gives the fallowing error: Caused by: java.lang.NoSuchMethodError: No virtual method zzckb()Z in class Lcom/google/firebase/FirebaseApp; or its super classes (declaration of 'com.google.firebase.FirebaseApp' appears in /data/app/com.bogroup.ucuncuprogram-1/split_lib_dependencies_apk.apk:classes25.dex) My java code is lke the fallowing: package com.bogroup.ucuncuprogram; import android.content.Context; import

Firebase return child that have biggest value

天大地大妈咪最大 提交于 2019-12-24 06:57:35
问题 I am using firebase for a little while but I have stuck at one problem that I want to get the child that have the biggest value: Example here's my json (edited manually): { "Players" : { "Scores" : { "-JFUIwudw93dkD" : { "rank" : 0 }, "-KSFOW833nSfkod" : { "rank" : 8 }, "-Kk5WfuJ8mlZTPdeUC40" : { "rank" : 2 }, "-SKKQuyhso83ds" : { "rank" : 14 } } }, I need to get the child key for the highest rank. So I need the "-SKKQuyhso83ds" child. I have use this method but It doesn't work: final

how to get firebase.database.ServerValue.TIMESTAMP on update operation

☆樱花仙子☆ 提交于 2019-12-24 06:49:28
问题 is it possible to get firebase.database.ServerValue.TIMESTAMP value after I did update operation? my code looks like return firebase.database().ref('pathurl...').update(newData); and my newData have inside attribute that have firebase.database.ServerValue.TIMESTAMP is it possible to get the TIMESTAMP value that I push? 来源: https://stackoverflow.com/questions/43033453/how-to-get-firebase-database-servervalue-timestamp-on-update-operation

Android - Firebase - Issue with getChildrenCount() method

感情迁移 提交于 2019-12-24 06:39:27
问题 Currently, I'm building an Android App which is using a Firebase Database. In my code, I'm trying to get the number of Children in a specific path of my Firebase Database. Having defined the reference of the Firebase specific path, I have made a Listener in order to get the DataSnapshot and then to call getChildrenCount(). After that, I want to use this result in a FOR-Loop. However, the code doesn't work. It appears that it is executed first the FOR-Loop (I realised that because Log.v("NUM

Firebase update() not a function with a query

徘徊边缘 提交于 2019-12-24 06:30:03
问题 I'm trying to update a property in a record in Firebase Database, with AngularJS. I can set up a query to find my record: firebase.database().ref('en/').orderByChild('word').equalTo('the').once('value') .then(function(snapshot) { snapshot.forEach(function(childSnapshot) { console.log(childSnapshot.val()) }); }) I can update my property, if I hardcode in the record's key: firebase.database().ref('en/-KloeQHDC-mugPjJMAG4').update({ wordFrequency: 111 }) But if I set up a query to find the

Retrieving common values in Firebase

孤人 提交于 2019-12-24 06:29:54
问题 What's the most efficient way to pull all common elements from Firebase? I'm trying to pull all posts where the postName is the same and get their respective userId and append it into an array. Based on the database structure below, the output should be ["userId1","userId2","userId4", "userId5"]. func fetchPosts() { let usersRef = Database.database().reference().child("posts") usersRef.observeSingleEvent(of: .value, with: { snapshot in for child in snapshot.children.allObjects as!

How to retrieve the data from Firebase database using REST APIs in android?

点点圈 提交于 2019-12-24 06:27:06
问题 First time i am working with fire base,when am trying to retrieve the data using fire base rest apis i get the response like this, { "-JQjT7REctmFfOAoGI6d" : { "age" : "23", "name" : "xxx", "id" : "1" }, "-JQjT7RGTUdl1FTrjed6" : { "age" : "34", "name" : "xxx", "id" : "1" } } it contain multiple json objects with diffrent ids without jsonarray.i want to store this data in objects. 回答1: If you are having problem in parsing just because of keys then you can use a iterator and extract the keys

accessing nested firebase data in swift

情到浓时终转凉″ 提交于 2019-12-24 06:24:09
问题 I am working wth a data structure, and I am looping through a couple nodes and here is the json data I get. Snap (20171012) { "-KwM45HyW4UduQgKTGn6" = { ImageName = "Screen Shot 2017-10-13 at 11.24.51 AM.png"; fileURL = ""; thumbFileUrl = ""; user = "User not defined"; }; "-KwM4limD2aRyHgeKE5P" = { ImageName = "test.png"; fileURL = ""; thumbFileUrl = ""; user = "User not defined"; }; } After this, I can access the "snap" value using my data.key to get the "20171012" ref.child(myselected_spot!

Path to Firebase Admin Key in Java servlet

江枫思渺然 提交于 2019-12-24 06:17:10
问题 I keep getting a FileNotFoundException when trying to initialize my app with Firebase saying it cannot find my adminsdk.json service key . This is a specific error as I am trying to initialize Firebase in an Android Module Servlet . Here is what my module project structure looks like: And here is the code in my Serlvet that is trying to intialize FirebaseOptions : FirebaseOptions options = null; try { options = new FirebaseOptions.Builder() .setServiceAccount(new FileInputStream("leadsbackend