Im working on a chat app, using firebase and javascript. I encountered a problem, when I switch receivers multiple times, the message that I sent fetches a few times while the messages is sent only once to the database. Here is how it looks when it fetches, after a switch receivers a few times As you can see, the first
Tag: firebase
map method not running
I have an array, I push doc data from firebase into that array and I want to display a table row for each doc. The problem is that the map method won’t do anything. Answer First of all, you need to update the state by setAllScores
How to remove images from Firebase Storage?
I’m trying to adapt a React Native project to the new Firebase methods. In it I upload images to Storage and they are added to the App interface. I can also remove these images from the interface as shown in the following code: The problem is that in this way, they are only removed from my App, while the images
React native firebase handling payment flow
I am integrating payment api, I’m using firebase cloud functions as my backend and react-native in frontend, so right now i have the following code: In react-native side: firebase function to handle payment: So the question is, how can I handle long-time response/timeout error/network-loss etc in react-native side, like how should I make it more robust? especially handling long-time responses,
React firebase doesn’t await
I want to get data from firebase and map it and render a table with it but the firebase function returns data after the page loads. now if I make a var here let’s say var text= datas and console.log it it will return undefined the feed var is just some dummy text is there any way to make the
Firebase Cloud Storage – upload with metadata –
I wish to upload files from the browser with metadata that will allow the files to be identified and handled correctly with cloud functions. On the client my uploader code looks like this: And on the server (Firebase Cloud Functions using Node js) The uploadHandler is working – but metadata is undefined, as is metadata.metadata How can I access the
Firebase firstore auto increment number not working (React js)
i searched for many solutions but its all say somthing like this. so if any one can help me then it will be very good form me. Answer I think you’re mixing and matching SDK versions, or at least syntax. Try using the increment top-level function from the regular v9 SDK (not its compat library).
Firebase Firestore returns [object Object] instead of instead of a plain object
I have a custom hook called useDocument.js below which fetches the data from a firestore collection via a specific ID. Why is it that it’s returning [object Object] instead of plain object. I’ve tried accessing the name property and logging it to the console using document.name but throws up an error: Uncaught TypeError: Cannot read properties of null (reading ‘name’)
Realtime database cloud function sends result back before finishing
I’m trying to perform some realtime database tasks, which after completion, should send back a result back to the client so the client knows when the tasks have finished. I’ve tried to create a promise due to the fact some realtime database tasks do not return a promise – wasn’t sure which one. Based on the logs, the function completed
Exporting a boolean variable that depends on an if statement (React JS & Firebase)?
I’m trying to declare a boolean from my firebase.js configuration file that depends on an if-else statement that checks whether a user is logged in or not. I want to store the log in status of a user in a boolean variable and export that variable across different components in my React app. So if user is logged in I