firebase-realtime-database

How to retrieve data from Firebase Database?

廉价感情. 提交于 2020-01-09 19:41:35
问题 I'm trying to create a simple program that takes name, mobile number and email address from user and then puts the data on Firebase Realtime Database. There are 3 input boxes and a button which on click does the above operation. Here is the code: <input type="text" id="name"> <input type="text" id="mobile"> <input type="text" id="email"> <button type="button" id="button" onclick="addLead()">Submit</button> I've set up Firebase like this: <script src="https://www.gstatic.com/firebasejs/3.2.0

How to retrieve data from Firebase Database?

安稳与你 提交于 2020-01-09 19:40:16
问题 I'm trying to create a simple program that takes name, mobile number and email address from user and then puts the data on Firebase Realtime Database. There are 3 input boxes and a button which on click does the above operation. Here is the code: <input type="text" id="name"> <input type="text" id="mobile"> <input type="text" id="email"> <button type="button" id="button" onclick="addLead()">Submit</button> I've set up Firebase like this: <script src="https://www.gstatic.com/firebasejs/3.2.0

Android firebase getting null

ε祈祈猫儿з 提交于 2020-01-09 12:00:03
问题 I'm using Firebase to save my data. I'm trying to separate Firebase methods and my methods on the activity. For example i have created class that called "FirebaseMethodsHelper" and there i want to write all the Firebase methods. For example, "getAllUsers" method that should return in list all the users. The only problem i have that it does not working. I dont know what im doing wrong, so if you guys please can help me. Fragment public class MyPlayListFragment extends Fragment { private

Android firebase getting null

牧云@^-^@ 提交于 2020-01-09 11:59:05
问题 I'm using Firebase to save my data. I'm trying to separate Firebase methods and my methods on the activity. For example i have created class that called "FirebaseMethodsHelper" and there i want to write all the Firebase methods. For example, "getAllUsers" method that should return in list all the users. The only problem i have that it does not working. I dont know what im doing wrong, so if you guys please can help me. Fragment public class MyPlayListFragment extends Fragment { private

error “java.lang.StackOverflowError:” when try to save object in Firebase Database

此生再无相见时 提交于 2020-01-09 11:16:12
问题 I am new to the firebase. I tried to save the properties of the users listed in my application into the database Firebase , this is code mAuthListener = new FirebaseAuth.AuthStateListener() { @Override public void onAuthStateChanged(@NonNull FirebaseAuth firebaseAuth) { firebaseuser = firebaseAuth.getCurrentUser(); if (firebaseuser != null) { finish(); firebaseuser = mAuth.getCurrentUser(); String nama = firebaseuser.getDisplayName(); String mail = firebaseuser.getEmail(); //String pass =

Wildcard query on Firebase?

≡放荡痞女 提交于 2020-01-09 10:22:00
问题 Is it possible to do wildcard queries on Firebase? For example: https://foo.firebaseio.com/person.json?orderBy="name"&equalTo="Lun*" 回答1: I know it's been a while but I thought that others might be interested. You can "fake" a wildcard search for things like foo* (so basically you can search for values beginning with a specified string). For iOS & Swift it would look like this: dbReference.child("person").queryOrdered(byChild: "name").queryStarting(atValue: "foo").queryEnding(atValue: "foo\u

Wildcard query on Firebase?

一个人想着一个人 提交于 2020-01-09 10:21:48
问题 Is it possible to do wildcard queries on Firebase? For example: https://foo.firebaseio.com/person.json?orderBy="name"&equalTo="Lun*" 回答1: I know it's been a while but I thought that others might be interested. You can "fake" a wildcard search for things like foo* (so basically you can search for values beginning with a specified string). For iOS & Swift it would look like this: dbReference.child("person").queryOrdered(byChild: "name").queryStarting(atValue: "foo").queryEnding(atValue: "foo\u

Cloud Functions for Firebase: Increment Counter

≯℡__Kan透↙ 提交于 2020-01-09 08:54:47
问题 Is it acceptable to increment a counter with a realtime database trigger using transaction? exports.incPostCount = functions.database.ref('/threadsMeta/{threadId}/posts') .onWrite(event => { admin.database().ref('/analytics/postCount') .transaction(count => { if (count === null) { return count = 1 } else { return count + 1 } }) }); 回答1: Definitely! In fact, that's exactly how it's done in this code sample, although with a few small differences: exports.countlikechange = functions.database.ref

Swift Firebase Must be a non-empty string and not contain '.' '#' '$' '[' or ']'

醉酒当歌 提交于 2020-01-09 08:19:05
问题 This is a follow up to my previous question. I am trying to see if an email has already been used. I am using the line if snapshot.hasChild(email) { I have in my database an email test1@test.com When I type that in..the moment I get to the '.' before com the app crashes and gives an error that says this Must be a non-empty string and not contain '.' '#' '$' '[' or ']' I see a lot of posts about checking for usernames, but my app doesn't have usernames, just email. Am I able to use email with

How to handle asynchronous Database with Firebase?

蹲街弑〆低调 提交于 2020-01-09 08:15:30
问题 I have a lot of questions about handeling asynchronous database in my Android app. Since I know that database is asynchronous, I've tried several things to handle it. As you can see in my code, I've two functions who need to use an array in my database. My first function ( setArrayfromDatabase ) will apply changes on my array in my database and my second function ( setAnotherArray )need to use this array with changes applied from my first function. Here's my code : FirebaseDatabase database =