firebase-realtime-database

Append Firebase data to an array in Swift ios

♀尐吖头ヾ 提交于 2020-01-02 09:58:40
问题 I don't know what I am doing wrong! I just simply want to take data from Firebase database and iterate for each result and put them into an array. I have tried serval different approaches. But they all return results adding one at a time to the array. I have data like below: { "1400001" : { "HHtype" : 3, "Sesgrup" : 4, "lg_Et harcaması" : 0, "lg_Total Harcama" : 3.11 }, "1400002" : { "HHtype" : 1, "Sesgrup" : 4, "lg_Et harcaması" : 1.2, "lg_Total Harcama" : 3.15 }, "1400004" : { "HHtype" : 3,

Firebase startAt String only takes first character

徘徊边缘 提交于 2020-01-02 09:56:34
问题 I have a structure like below under xyz { "pushKey000": { "findKey": "john_1", "userName": "john", "topic": 1 }, "pushKey001": { "findKey": "john_2", "userName": "john", "topic": 2 }, "pushKey002": { "findKey": "joel_1", "userName": "joel", "topic": 1 } } Now am trying to make a query where I want data of all entries with findKey starting with " john ". I tried the following:(Using REST for example) https://abc.firebaseio.com/xyz.json?orderBy="findKey"&startAt="john" This gives me all the

How to sort Firebase Keys in ascending order?

橙三吉。 提交于 2020-01-02 08:19:38
问题 I have a list of products in my Firebase Database. My SKU looks like this c08p10 . But the problem is that Hundred product is shown after the tenth product. Please refer the screenshot for the jumbled product order. I can understand that the products are arranging alphabetically. But how can i display the products in the below order c08p10 c08p11 c08p12 NOTE I can populate the data in a List view or recycler View. But the products are arranged in the firebase DB order. If I try to reverse the

How to sort Firebase Keys in ascending order?

本秂侑毒 提交于 2020-01-02 08:19:09
问题 I have a list of products in my Firebase Database. My SKU looks like this c08p10 . But the problem is that Hundred product is shown after the tenth product. Please refer the screenshot for the jumbled product order. I can understand that the products are arranging alphabetically. But how can i display the products in the below order c08p10 c08p11 c08p12 NOTE I can populate the data in a List view or recycler View. But the products are arranged in the firebase DB order. If I try to reverse the

java.lang.RuntimeException: Could not deserialize object. Failed to convert value of type java.lang.Long to boolean

橙三吉。 提交于 2020-01-02 07:47:10
问题 I have big problem. Runing the app using Android Emulator works good, but when I put the app on a real phone i get this error : java.lang.RuntimeException: Could not deserialize object. Failed to convert value of type java.lang.Long to boolean (found in field 'imp') My Firebase data is OK, 'imp' field is a boolean in the database, so what I'm retrieving is a boolean from databae and storing it in a boolean var. How can it say that I receive a Long when the data is sent from Firebase as a

Create user in database after Firebase Auth (android)

不羁的心 提交于 2020-01-02 01:04:16
问题 I'm building an Android app and I want my users to be Auth then added to the database. For now I'm only doing the Auth with an email and password, then I click register and the user is created in the Auth section in the Firebase console. But I also want my users to be added in the database. I want to add more fields (such as name, address etc) which will be stored in the users database in Firebase. I just don't really see how to do that. Anyone could explain please? Thanks! 回答1: You should

Firebase Notifications using node.js

女生的网名这么多〃 提交于 2020-01-01 19:58:34
问题 I'm working with Firebase notifications using node.js. After compile, when I'm sending request to other user of app (request makes notification), firebase log shows error: TypeError: Cannot read property 'receiver_id' of undefined at exports.sendNotification.functions.database.ref.onWrite.event (/user_code/index.js:12:36) at Object. (/user_code/node_modules/firebase-functions/lib/cloud-functions.js:112:27) at next (native) at /user_code/node_modules/firebase-functions/lib/cloud-functions.js

Firebase Database indexPath

我与影子孤独终老i 提交于 2020-01-01 19:45:40
问题 I'm trying to retrieve data from firebase using this function but I'm not getting all the data: func retrieveVideos(_ completionBlock: @escaping (_ success: Bool, _ error: Error?) -> ()) { let userMessagesRef = DataService.instance.REF_ARTISTARTS.child(Auth.auth().currentUser!.uid) userMessagesRef.observe(.childAdded, with: { [weak self] (snapshot) in if let snapshot = snapshot.children.allObjects as? [DataSnapshot] { print("SNAPSHOT: (snapshot.count)") = 12 } guard let strongSelf = self else

How to Get Value from Firebase in Xamarin?

拟墨画扇 提交于 2020-01-01 19:35:15
问题 How to Get Data from Firebase Realtime Database using Xamarin Firebase.Database Android, as there is no documentation available and I am new user. public void GetSubjects() { Database.Reference.Child("childName").Ref.AddListenerForSingleValueEvent(new ValueEventListener()); } public class ValueEventListener : Java.Lang.Object, Firebase.Database.IValueEventListener { public void OnCancelled( DatabaseError error ) { throw new NotImplementedException(); } public void OnDataChange( DataSnapshot

Using ServerValue.TIMESTAMP in my Android App

社会主义新天地 提交于 2020-01-01 19:19:05
问题 I have read lots of stackoverflow questions related to ServerValue.TIMESTAMP but I can't figure out how to use it in my app. I need to get the timeStamp of the creation of a post. The timeStamp should be added to the same place as with uid , author etc. of the post. Code snippet which writes the post the firebase database: private void writeNewPost(String userId, String username, String title, String body) { // Create new post at /user-posts/$userid/$postid and at // /posts/$postid