firebase-realtime-database

Reading nested data from Firebase returns something else than an array

纵然是瞬间 提交于 2020-03-05 06:04:12
问题 Trying to read (and expect) a nested array like this: var array = [ 0: {subArrayy: {...}, title: "Title"}, 1: {subArray]: {...}, title: "Title"}, ... However after reading and (!) outputting, the result is fine. My web console shows me the array and everything seems good. BUT doing array.length returns 0. And any iteration returns undefined. I've tried using ladosh _.toArray thing that I've seen earlier, but it does absolutely nothing. var locations = []; // Empty array var ref = db.ref(

How to get value of Child of childs from firebase in java

*爱你&永不变心* 提交于 2020-03-05 05:52:30
问题 From this I want take the value of email from mailID and subject, title from mailText.i'm able to access the value of single child but when it show null with when try get with all three. Following code working for single child: DatabaseReference databaseRef = database.getReference("/"); databaseRef.addValueEventListener(new ValueEventListener() { public void onDataChange(DataSnapshot dataSnapshot) { ArrayList<String> email = new ArrayList(); for (DataSnapshot sd: dataSnapshot.getChildren()) {

How to add remove data function of Firebase Realtime Database

别说谁变了你拦得住时间么 提交于 2020-03-05 05:24:05
问题 I creating chat system by React and Firebase . The data of chat stystem is managemented by Firebase RealTimeDatabase . Now site here URL: https://react-chat-b0e8a.firebaseapp.com/ Github: https://github.com/kaibara/React-chat I trying to create data remove function. However, I could not find an element to put in child() . Because, I can't use remove() code. I called firebase documentation and thought about implementing the delete function using update () and set () etc. However, since child (

How to get data for a specific User using their uid?

北城余情 提交于 2020-03-05 04:27:06
问题 I would like to get data for a specific user, which I know its uid, I want to retrieve all the data that is for that specific user. Can you help me on how to retrieve the user data? Thank you in advance func grabbingData() { let specificDatabase = Database.database().reference(withPath: "Data") let query = specificDatabase.queryOrdered(byChild: "uid").queryEqual(toValue: "ghD0lYZV1QOeJ2giUc3fNVxsLAV2") query.observeSingleEvent(of: .value, with: { (snapShot) in for child in snapShot.children {

firebase realtime funtions using multiple databases

孤街醉人 提交于 2020-03-04 19:39:11
问题 We have two different firebase projects each with its own firebase functions and realtime database used. we have come to a situation where we want to leverage one of the dataset (a node in the realtime db) from project 1 into the project 2. As this node is read-only true so i can a access it in the format https://myproject.firebaseio.com/prj1db/nodeX.json but that will give entire data for this node. What i need is to query specific data like i do using below format for the db attached to the

Android with Firebase : DataSnapshot.getValue() throws java.lang.IllegalArgumentException

风流意气都作罢 提交于 2020-03-03 09:07:10
问题 I am writing and reading class User from Firebase realtime database. This is User class : public class User { public String name; public int number; public String title; public String company; public String location; public Bitmap image; public String name_title_company_location; public User() { // Default constructor required for calls to DataSnapshot.getValue(User.class) } public User(String name, int number, String title, String company, String location, Bitmap image) { this.name = name;

Android Firebase uploading images wrong URL (PROBLEM: X-Goog-Upload-Comment header is missing)

半腔热情 提交于 2020-03-03 07:28:09
问题 I'm trying to upload and download images from Firabase Database which has an URL link to Firebase Storage. The problem is that the strange URL is being saved to database (see the link at the bottom). What should I do to obtain a normal URL that I will be able to use do downloand the image into my Android app? Thank you in advance! Here I post some code I use: Upload to Firebase DataBase and Storage: mStorageRef = FirebaseStorage.getInstance().getReference(); mDataBaseRef = FirebaseDatabase

Android Firebase uploading images wrong URL (PROBLEM: X-Goog-Upload-Comment header is missing)

情到浓时终转凉″ 提交于 2020-03-03 07:28:07
问题 I'm trying to upload and download images from Firabase Database which has an URL link to Firebase Storage. The problem is that the strange URL is being saved to database (see the link at the bottom). What should I do to obtain a normal URL that I will be able to use do downloand the image into my Android app? Thank you in advance! Here I post some code I use: Upload to Firebase DataBase and Storage: mStorageRef = FirebaseStorage.getInstance().getReference(); mDataBaseRef = FirebaseDatabase

how to add data to the existing database in a firebase realtime database?

倖福魔咒の 提交于 2020-02-29 07:30:28
问题 my code: lateadd.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { FirebaseUser user = FirebaseAuth.getInstance().getCurrentUser(); String anahtar=databaseReference.getKey().toString(); final String kisiId = user.getUid().toString().trim(); final String kisiAd = user.getDisplayName().toString().trim(); final String yayinlananYorum = edituruneYorumyap.getText().toString(); List<Urun> urunListesi = new ArrayList<>(); Urun urunler = new Urun(kisiId, kisiAd,

Firebase Database Rules Timestamp Issue

筅森魡賤 提交于 2020-02-28 15:35:47
问题 Since the time shift at the 29th of October 2017 I'm running in some really strange behaviours while developing with the firebase products. I'm developing a hybrid app with Ionic (3). While I'm developing and testing in the browser (mobile emulated device) everything works fine. As soon as I switch to my real device (Samsung Galaxy S7, no root, modded or something else), all writes to the database with a timestamp are failing. In my code I create a timestamp like this: Date.now() In my