firebase-realtime-database

Cannot retrieve data using FirebaseRecyclerOptions after upgrading to FirebaseUI 3.0

允我心安 提交于 2021-02-10 05:50:23
问题 I'm using FirebaseRecyclerOptions because I upgraded to the new FirebaseUI 3.0 version but now I cannot retrieve anything from the database. The same code used to work very well in the old FirebaseRecylcerAdapter method. It seems like it doesn't even enter onBindViewHolder . Initializations linearLayoutManager = new LinearLayoutManager(this); linearLayoutManager.setReverseLayout(true); linearLayoutManager.setStackFromEnd(true); recyclerView = findViewById(R.id.main_recycler); recyclerView

Firebase Database loop through children starting from last child

微笑、不失礼 提交于 2021-02-10 05:17:20
问题 I have this loop through children: public void onDataChange(DataSnapshot snapshot) { for (DataSnapshot postSnapshot: snapshot.getChildren()) { przejazd = postSnapshot.getValue(Przejazd.class); System.out.println(przejazd.getAdres_koniec()); przejazdList.add(przejazd); mAdapter.notifyDataSetChanged(); } } But I want to loop from last child to first child, how to do it? 回答1: From what I know, you can't do it with current API. If you want to reverse it, you can do it with the obtained list.

Vue.js with Firebase

一个人想着一个人 提交于 2021-02-10 05:13:52
问题 I'm trying to create a simple read/write app with Vue.js, VueFire and Firebase. <!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title>App</title> <!-- Vue --> <script src="https://unpkg.com/vue@2.0.3/dist/vue.js"></script> <!-- VueFire --> <script src="https://cdn.jsdelivr.net/vuefire/1.1.0/vuefire.min.js"></script> <!-- Firebase --> <script src="https://www.gstatic.com/firebasejs/3.5.2/firebase.js"></script> </head> <body> <div id="app"> <ul> <li v-for="story in stories"> {{ story.body

When I use Promise with dialogflow library in server - get Error

断了今生、忘了曾经 提交于 2021-02-09 07:02:16
问题 I try to execute this code on Firebase Cloud Functions const functions = require('firebase-functions'); const admin = require('firebase-admin'); const firebase_database = require('./conf/firebase'); const { WebhookClient } = require('dialogflow-fulfillment'); exports.dialogflowFirebaseFulfillment = functions.https.onRequest((request, response) => { function searcheColleagueByName(agent){ var lastname = agent.parameters.lastname; firebase_database.ref().once('value') .then(team => { agent.add(

When I use Promise with dialogflow library in server - get Error

删除回忆录丶 提交于 2021-02-09 07:00:17
问题 I try to execute this code on Firebase Cloud Functions const functions = require('firebase-functions'); const admin = require('firebase-admin'); const firebase_database = require('./conf/firebase'); const { WebhookClient } = require('dialogflow-fulfillment'); exports.dialogflowFirebaseFulfillment = functions.https.onRequest((request, response) => { function searcheColleagueByName(agent){ var lastname = agent.parameters.lastname; firebase_database.ref().once('value') .then(team => { agent.add(

Firebase Functions error: .once is not a function

被刻印的时光 ゝ 提交于 2021-02-08 21:47:10
问题 I am trying to deploy a simple function to Firebase, but I am having some difficulties. Every time I try to use .once on a reference Firebase tells me that it is not a function. Here is my code exports.testFunction = functions.database.ref('/Rooms/{firstID}/{pushId}/On').onWrite(event => { const value = event.data.val(); var ref = functions.database.ref(roomNum); return ref.once('value').then(snapshot => { console.log(snapshot.numChildren); return true; }); }); I have also tried the following

How to send data from SQLite database to Firebase database

£可爱£侵袭症+ 提交于 2021-02-08 12:09:45
问题 I am creating a Android app that stores data like name, number to SQLite database. I need to push the data from SQLite to Firebase. This is the SQLite code for the app which stores the data in detailsdb sqLiteHelper = new SQLiteHelper(this, "DetailsDB.sqlite", null, 1); sqLiteHelper.queryData("CREATE TABLE IF NOT EXISTS DETAILS(Id INTEGER PRIMARY KEY AUTOINCREMENT, name VARCHAR, phone VARCHAR, location VARCHAR)"); onClick save try { sqLiteHelper.insertData( eName.getText().toString().trim(),

Correct JSON structure to filter through data [closed]

可紊 提交于 2021-02-08 11:39:41
问题 Closed . This question needs to be more focused. It is not currently accepting answers. Want to improve this question? Update the question so it focuses on one problem only by editing this post. Closed 1 year ago . Improve this question What's the "best" JSON structure when you need to "filter" through data in Firebase (in Swift)? I'm having users sort their questions into: Business Entertainment Other Is it better to have a separate child for each question genre? If so, how do I get all of

Schedule jobs in Firebase

假装没事ソ 提交于 2021-02-08 11:36:56
问题 I am assuming that someone has reserved 4:30 now and wants to save it to the server and notify the server from the server at 4:30. I do not want to use the alarm system built into the smartphone. I also watched Firebase cloud function lectures on YouTube and implemented them. And I've also seen CronJobs, which gets into the URL by alarm on time and executes the function. I have to set the time for the user and give an alarm to each individual. 回答1: There is no straight forward way of doing

DataSnapShot Object's value returning null on getvalue(Boolean.class)

岁酱吖の 提交于 2021-02-08 11:20:09
问题 I'm doing a realtime tracking application from a tutorial online, Here i'm setting the presence system using firebase. But it's crashing with: /java.lang.NullPointerException: Attempt to invoke virtual method 'boolean java.lang.Boolean.booleanValue()' on a null object reference I don't understand what's wrong the guy who coded this has it working perfectly. The exception is happening at this line : if(dataSnapshot.getValue(Boolean.class)){ When i log this on screen the datasnapshot object has