firebase-realtime-database

Firebase - Prevent user authentication

主宰稳场 提交于 2019-12-24 07:58:41
问题 I need to prevent user authentication if their email isn't found in allowedUsers . It doesn't really affect the app, since all the actions will be performed on the users list, but it will be nice if the authentication doesn't happen. loginWithGoogle() { const userDetails = this.afAuth.auth.signInWithPopup(new firebase.auth.GoogleAuthProvider()) .then(user => { console.log(user.user.uid); const queryObservable = this.db.list('/allowedUsers', { query: { orderByChild: 'email', equalTo: user.user

Firebase (Web) can't get orderByChild to work

橙三吉。 提交于 2019-12-24 07:58:08
问题 I know that there are 1,000 answers out there to this question, which is partially why I'm so confused by the fact that I can't get it to work. I can't get the orderByChild query / filter to work. I've looked at at least 25 tutorials, guides, and articles online that explain it and they all seem to say to do exactly what I'm doing: var dbRef = firebase.database().ref(); var filterExperience = dbRef.child("Users").orderByChild('trade_general').equalTo('Construction'); filterExperience.on(

Invalid Firebase Path error while fetching database

家住魔仙堡 提交于 2019-12-24 07:43:58
问题 I am using Firebase for both authentication and realtime database. My authentication code was successfully run also my enter value to database code also run, but when I am coding for fetch value in database, I am getting run time error trying to enter value at Firebase database: FATAL EXCEPTION: main Process:com.xxx.xxx, PID: 22601 com.google.firebase.database.DatabaseException: Invalid Firebase Database path: https://xxx-exxe.firebaseio.com/. Firebase Database paths must not contain '.', '#'

Recylerview not automatically loading data from firebase Android Studio

不羁的心 提交于 2019-12-24 07:38:15
问题 I have tried everything but my data from firebase is not getting loaded automatically when I open the app and I have to click a edittext to load the data. I have tried adapter.Update(data); recycler.invalidate(); notifyDataSetChanged(); adapter.notifyDataSetChanged(); Please can someone help me out. EDITED: I am saving to firebase like this: public FirebaseHelper(DatabaseReference db) { this.db = db; } //WRITE IF NOT NULL public Boolean save(Spacecraft spacecraft) { if(spacecraft==null) {

Why does firebase “on” “value” not run the listener function when the reference doesn't exist, but “once” “value” does?

99封情书 提交于 2019-12-24 07:28:41
问题 Say I'm listening to a widget: const ref = firebase.database().ref(`widgets/${widgetId}`); ref.on('value', function(snapshot){ console.log(snapshot.val()); // <-- I never see this if ref doesn't exist! } If that widget doesn't exist I want to know about it. I'd expect snapshot.val() to return null . But the problem is the function isn't run at all. So I can't event check for null . It just stays silent. The weird thing is, this fixes it: const ref = firebase.database().ref(`widgets/${widgetId

Limiting the firebase equalTo query with the optional key parameter

こ雲淡風輕ζ 提交于 2019-12-24 07:28:11
问题 I have a feeling I may have the understanding of this feature wrong coming from the SQL background. The documentation is sparse and I haven't been able to find a good example or an explanation. I am looking for a clarification to the following from https://github.com/angular/angularfire2/blob/master/docs/4-querying-lists.md: 1 The Firebase SDK supports an optional key parameter for startAt, endAt, and equalTo when ordering by child, value, or priority. You can specify the key parameter using

How to increment number in firebase

北城余情 提交于 2019-12-24 07:27:55
问题 I've edited the code. It works. It increment the counter in firebase. But there is 1 problem. Whenever I restart the app (after clear recent app), the increment starts over. It does not continue from previous number. public class MainActivity extends AppCompatActivity { Button bNext; long count; DatabaseReference mRootRef = FirebaseDatabase.getInstance().getReference(); DatabaseReference mCounterRef = mRootRef.child("counter"); @Override protected void onCreate(Bundle savedInstanceState) {

Firebase : How to read every child node in parent except children with particular data

房东的猫 提交于 2019-12-24 07:25:11
问题 Assume the following. posts : { "$postid":{ "meta":{ "state":true, "text" :"I should be read", }, "likes":{ "uid1":true, "uid2":true, }, }, "$postid":{ "meta":{ "state":false, "text" :"I should be read", }, "likes":{ "uid1":true, "uid2":true, "uid3":true, }, } } I want to query the parent node('posts') as follows. Leave out posts with state = false Prioritise posts with most likes Security Rules Deny posts with state == false to be read. Here's the Javascript Version Of how I'm querying data.

flutter how to make gridview show firebase data like buttons

不羁岁月 提交于 2019-12-24 07:23:51
问题 I am trying to user Streambuilder to display gridview, but it return this error, I am calling the method classList() to container in scaffold body database = FirebaseDatabase.instance I want to show classData, show 0,1,2..etc I want to show ('className','classSection' in one button per child) in gridview as RaisedButtons I get this error when the code below is executed I/flutter ( 5433): ══╡ EXCEPTION CAUGHT BY WIDGETS LIBRARY ╞═══════════════════════════════════════════════════════════ I

Firestore query List map object

独自空忆成欢 提交于 2019-12-24 07:13:51
问题 Can someone help me to query the list of map object in the collection? Please find sample document below see my sample document from firestore In above the image I want to fetch the GROUP collection based on personId which is basically List type. Searching for solution android. Please advise 来源: https://stackoverflow.com/questions/52343063/firestore-query-list-map-object