firebase-realtime-database

using firebase admin sdk on a web client

对着背影说爱祢 提交于 2020-01-23 03:12:06
问题 I need to use the firebase admin sdk to authenticate myself on the back-office of my project. using the sdk on the server side is working just fine. but with a reactjs component (a chat component) to chat between web client and a mobile app, the sdk is not working displaying the following error: Uncaught TypeError: rtdb.initStandalone is not a function at DatabaseService../node_modules/firebase-admin/lib/database/database.js.DatabaseService.getDatabase Has anyone tried this before or is it

Firebase Java Admin SDK don't work

醉酒当歌 提交于 2020-01-23 02:46:27
问题 I am following the documentation on Firebase website on setting up an Java Admin SDK. So I add the dependency to the build.gradle, and added the following code: import java.io.FileInputStream; import java.io.FileNotFoundException; import java.util.HashMap; import java.util.Map; import com.google.firebase.FirebaseApp; import com.google.firebase.FirebaseOptions; import com.google.firebase.auth.FirebaseCredentials; import com.google.firebase.database.DatabaseReference; import com.google.firebase

Tried to get frame for out of range index NaN (realtime database)

依然范特西╮ 提交于 2020-01-22 17:59:48
问题 I'm trying to render some rows from firebase database, I'm getting this error: TaskQueue: Error with task : Invariant Violation: Tried to get frame for out of range index NaN const { currentUser } = firebase.auth(); var userfavorites = firebase.database().ref(`/users/${currentUser.uid}/favorites/`); userfavorites.once('value').then(snapshot => { this.setState({ userfav: snapshot.val() }) }) ... <FlatList data={this.state.userfav} renderItem={({ item }) => ( <Text>{item.favdata}</Text> )} />

firebase realtime database once vs on?

女生的网名这么多〃 提交于 2020-01-22 03:45:07
问题 Im using firebase realtime database on node js like database for API. What's the different between once() and on() ? My code with once() work very slowly. What is it needed for off() ? Example router.get('/:qrid', async(req, res)=>{ let id = req.params.qrid; let ref = firebase.database().ref('/qr/'+id); let snapshot = await ref.once('value'); res.json(Object.assign({}, snapshot.val())); }); This work very slowly (250ms-3000ms). When I use on() it all faster. router.get('/:qrid',(req, res)=>{

HashMap doesn't write in the database

柔情痞子 提交于 2020-01-22 03:32:11
问题 I try to write in my database but only the sender and the message is written.I don't understand why this happens.I think the problem is where I use the sendMessage.I think the problem is that I don't have something to read/write the primary key for the other users. The Activity where I written in the database the messages. public class MessageActivity extends AppCompatActivity { TextView username; FirebaseUser fuser; DatabaseReference reference; Intent intent; ImageButton btn_send; EditText

getContactsFromFirebase() method return an empty list

末鹿安然 提交于 2020-01-22 03:09:19
问题 public List<String> getContactsFromFirebase(){ FirebaseDatabase.getInstance().getReference().child("Users") .addListenerForSingleValueEvent(new ValueEventListener() { @Override public void onDataChange(DataSnapshot dataSnapshot) { for (DataSnapshot snapshot : dataSnapshot.getChildren()) { Users user = snapshot.getValue(Users.class); assert user != null; String contact_found = user.getPhone_number(); mContactsFromFirebase.add(contact_found); Log.i("Test", mContactsFromFirebase.toString()); } }

Android Firebase multiple sort

我的梦境 提交于 2020-01-22 02:38:13
问题 I have a question about firebase sorting. I have the next database: { "-Ka8xxTgyFB8yYKH50j_addclose" : { "number" : 0, "point" : 949739, "timestamp" : 14824078463440, "username" : "Test 16062" }, "-Ka8xzKecpbPr46Kx9gl" : { "number" : 0, "point" : 1480851, "timestamp" : 14842078463441, "username" : "Test 13599" } } I want to display data sorted by point. But i need rows only which created today. If i filter the rows for timestamp: return databaseReference .child("list") .orderByChild(

Not getting data from Firebase in RecyclerView

对着背影说爱祢 提交于 2020-01-22 02:35:08
问题 everyone, I was trying to make a music app, and for this, I Created a Horizontal RecyclerView in my HomeFragment and my horizontal RecyclerView is getting an image with artist name. But after clicking I load another Activity. In my other activity, I was trying to load SongsData from firebase in a listView with RecyclerView . But the problem is I am not getting data from Firebase and it is returning null data. I provided my code below and here is the screenshot of my Firebase database:-

How to avoid downloading image from firebase if i have already downloaded previously?

别来无恙 提交于 2020-01-22 02:32:10
问题 I am trying to store image from firebase database and named it FirebaseuniqUserID.jpeg.(like buwkgefuikbuifbkc8gfybfy.jpeg). And user can change image anytime. For getting image link from firebase realtime database i used addListenerForSingleValueEvent. FirebaseDatabase.getInstance().getReference().child("Users").child(FirebaseuniqUserID).addListenerForSingleValueEvent(new ValueEventListener() { @Override public void onDataChange(@NonNull DataSnapshot dataSnapshot) { //here i am downloading

Flutter firebase realtime database in web

时光毁灭记忆、已成空白 提交于 2020-01-22 02:15:17
问题 I'm trying to get my flutter app working in the browser and it depends on firebase_database. There is not really any documentation for how to do this, but I'm making some assumptions based off the firebase_core and firebase_auth documentations: https://github.com/FirebaseExtended/flutterfire/tree/master/packages/firebase_core/firebase_core_web https://github.com/FirebaseExtended/flutterfire/tree/master/packages/firebase_auth/firebase_auth_web My app is working on iOS and android, but I'm