firebase-realtime-database

Database table design with duplication of data

主宰稳场 提交于 2019-12-24 18:43:45
问题 I was having some problem when trying to design for my firebase database structure. Basically, 1 account can have many receipts, 1 receipts can have many items. Here is the JSON: receipts { accountID1 : { receiptID1 : { date : "07/07/2017" store : { storeName : "store1" storeAddr : "addr1" } currency : { currencyName : "currency1" currentcySymbol : "$" } totalAmount : "50.00" items : { itemID1 : true, itemID2 : true, } } receiptID2 : { date : "08/07/2017" store : { storeName : "store1"

What is the best way to check the existence of every child in one node?

微笑、不失礼 提交于 2019-12-24 18:41:31
问题 FirebaseDatabase.getInstance().getReference("Block").addListenerForSingleValueEvent(new ValueEventListener() { @Override public void onDataChange(DataSnapshot dataSnapshot) { for (DataSnapshot snap : dataSnapshot.getChildren()) { if(snap.getKey().equals(myUID)){ FirebaseDatabase.getInstance().getReference("Block").child(myUID).addListenerForSingleValueEvent(new ValueEventListener() { @Override public void onDataChange(DataSnapshot dataSnapshot) { for (DataSnapshot snap : dataSnapshot

Firebase mobile connection testing issues for android

拜拜、爱过 提交于 2019-12-24 18:36:25
问题 I'm building an app using Firebase Realtime Database and I'm testing out the onFailure callback. I turn off my mobile data and run the code below. mDatabaseReference.updateChildren(childUpdates) .addOnFailureListener(new OnFailureListener() { @Override public void onFailure(@NonNull Exception e) { Toast.makeText(TeamActivity.this, R.string.toast_message_error_add, Toast.LENGTH_LONG).show(); } }); The issue is that the toast message doesn't pop up, then when I turn back on the mobile data, all

How to retrieve array data from children node in Firebase Realtime Database Java? (Firebase Recycler Adapter)

。_饼干妹妹 提交于 2019-12-24 18:28:13
问题 I knew my question is similar with the other questioners but it was not solved my problem because I am still curious about how to declare the item which is the children of parent node. This is my stucture data on my Firebase: I've tried to created the classes for my case: DolanIemClass.java private String name_tourism; private String location_tourism; private String info_tourism; private String telepon; private String url_photo; private String url_photo_collage; private double lat_location

which method should i use to fetch the phone number of a user which they provided during authentication [duplicate]

情到浓时终转凉″ 提交于 2019-12-24 18:26:35
问题 This question already has answers here : Firebase Auth: Get users by email or phone number (3 answers) Closed last year . DatabaseReference rootRef = FirebaseDatabase.getInstance().getReference(); DatabaseReference usersRef = rootRef.child("Users"); ValueEventListener eventListener = new ValueEventListener() { @Override public void onDataChange(DataSnapshot dataSnapshot) { ListView listView = (ListView) rootView.findViewById(R.id.usersList); ArrayAdapter<String> adapter; adapter = new

Displaying a users post on iOS

[亡魂溺海] 提交于 2019-12-24 18:23:01
问题 I am trying to display a users "post" in a table view on iOS. When a users writes a post and hits the post button in my app, the post is saved to my firebase real time data base but it is not displaying in the tableview on the viewcontroller on which the code is written in. I'm not sure if its my code or something to do with firebase not responding and showing the data. Here is my code: import Foundation import UIKit import Firebase class HomeViewController:UIViewController,

I cant get the values from Firebase and put them in to TextView in fragment

醉酒当歌 提交于 2019-12-24 18:13:17
问题 In my app, I created login and signup page and saved the user name and email to my Firebase database. I also made bottom navigation with fragment. I want to take these values(name, mail) from Firebase and put it into TextView in profile fragment. When I tried this, my app crashed. How can I solve this problem? public class ProfileFragment extends Fragment { private FirebaseDatabase mFirebaseDatabase; private FirebaseAuth mAuth; private String userID; private TextView tName; private TextView

Continue execution after data received from multiple location in Firebase

余生长醉 提交于 2019-12-24 18:10:06
问题 I know this might be a common question but I am really stuck at this point. I am receiving data from 2 multiple locations and after I received from both I need to continue executing and than return that data to the calling method. I am aware of this thread: https://stackoverflow.com/a/33204705/1820644 but it doesn't fit here actually as I need to return the data to the calling method. For the method that blocks UI thread I can call it from AsyncTask , there is no problem. But how can I return

How to find the users which are part of a firebase app?

江枫思渺然 提交于 2019-12-24 17:15:56
问题 I have a project in Firebase.This project has 2 apps: 1.Android 2.iOS I want to know which users are registered from android platform & likewise from iOS. Is there a way to know ? 回答1: May be there is no way to find android users and iOS users directly, you have to store a boolean value like for an example isAndroid in user table in Firebase Realtime Database while registration and after login fetch the value of isAndroid from user table and accordingly do the rest. 回答2: There is no built-in

React-Redux-Firebase - populate item with another item

回眸只為那壹抹淺笑 提交于 2019-12-24 16:47:56
问题 I am using react-redux-firebase. This is how my firebase data looks like once user submit the form: It pushes information to "contacts" and images to "uploadedFiles"(also used for file Storage path). I really want to have it as one item. Something like: contacts = { kydfsdcfasdfsadf :{ email: "user@gmail.com", firstName: Tom, lastName : "Smith", uploasedFiles:{ downloadURL:"dsfsdfsdsdvsdfgdsfgds", fullPath:"dfsdfsdf", mame:"q34deser4wefwsdf" } } } I feel like I should use Populate, but I can