As you can see in the picture below, every time I want to save data to the Firebase RealTime Database, I get these red "alerts" and the data won't be saved.
Initially, I thought it was an error of Authentication, but then I configured that too and still can't save data, although I can read it.
Do you know a way to resolve it? Or am I missing something or doing something wrong?
Thanks for your answers :)
If this was an authentication problem, the console would never show the data to begin with.
More likely you have another piece of code somewhere in your app (or in a backend process) that is listening to this same data, and writing back to the same location when it gets called.
Related
I have two screens:
Homefeed.dart
Profile.dart
On Homefeed screen all the data from various users is fetched from a server and is shown in a list of cards form.
On the Profile screen, only data that belongs to the logged in user is fetched.
The problem is that, there will be an overlap in the data that is fetched on the both the screens. For example if a user writes a post, it can show up on the Homefeed. Now if the user decides to perform any action such as like, delete, edit etc on thir post from the profile screen, then it should also update the same post that was fetched on the Homefeed screen.
Now unless user explictly refreshes the data, and send a request to server to fetch the updated data, what would be an ideal way to achieve this synchrony.
I did consider using a realtime database, but this will mean migrating current project and it might get expensive and might have problem of it own.
The other "hacky" way would be to maniuplate data somehow (I still havent figured it out) on the client side and show the update instead of fething new data from the server.
Or some other, more ideal way of achiving this, that I don't know of.
The best way is to reflect any changes of the user post i.e edit, delete in Profile.dart is by updating the database without tricking the just in the client side. Because you may reduce the database calls by tricking, but you are giving high chances of inconsistent data in database. Your database wouldn't be reliable.
Database should be the single source of truth
I would suggest, Every time HomeFeed.dart page is loaded , try loading the latest data from the database. If you are using real-time database, you dont have to check on every page load.
I'm using React and Firebase, and when I check the usage on Firestore, I see a lot of request being made. The problem is that I'm not the only one using it, so I don't know if most of them are mine or not. Is there anyway (using console maybe?) to know how many request I'm doing?
There is currently no way to track the source of reads and write happening in Firestore. You can only see the total volume of those requests in the console.
Yesterday my firebase app was working fine, and all of a sudden the Real-time database has been deleted. Is anyone else experiencing this? I can log in ok, but all my clients cannot fetch their data and neither can I. Please tell me this has happened before and it will come back to normal. I am currently on a flame plan with firebase.
Not a good look with my clients =(
any feedback is appreciated.
Thanks
C
Firebase Real Time Database and Firebase Auth both are different section and keep data separately. If your Firebase Real Time database has been deleted that means not deleted data of Auth.
Firebase Support was awesome in helping, however just received an email that they did not restore my data. Really weird, that it popped up out of nowhere. Has anyone else experienced this? In my console, the data branches where not there and it all looked deleted, I then had to click create a database and go to Real-time database and all of a sudden, an hour later, all my data showed on my screen. How is this possible? Crazy crazy crazy...
I am using Firebase's Realtime Database.
I am able to use my old device and permanently keep it on for checking if the host has left a party to therefore notify the users. However, this is inconvenient and there must be a simple server side solution.
I know how to code it (using .observe etc.) but I don't know where to run the code. The code will be on a loop to check if a host has left every 10 seconds (this is because the host may run out of battery so the database is not notified). Can I simply run it in functions somehow? Or using hosting?
The server code will send a request to the host, and if there is no response, the party has therefore been closed so it will tell the users.
Any help or pointers in the right direction are greatly appreciated.
If you have any questions, please ask!
It's not related to the iOS. Put your initial code into the viewDidLoad or init methods (depends on how do you write the code) and forget about it. Those methods are called once per an instance. For now Firebase works fine on your usecase. At least I don't have any wierd updates on the observe method. also you can specify what do you want to observe exactly in the Firebase (something like the new or last 15)
The solution to this was that even if the user left the app, they would still be in the party. I used user defaults so it can remember if the user was in a party so it can return them.
I also used Realtime Database triggers which can remove all information about a user with one action in the app (so all data gets removed, and not left behind, which would create a waste of unusable database memory).
I am trying to save some data from GPS to a local database. First time when i am entering data, it saves all velues. But after clear the data entry sheet it not saved in database. When i quit the app and again save some data, it enters easily. I m confused what happens in my app ? Any help really appreciated.
Thanks in advance.
Try to debug your app. It seems you are passing some wrong arguments. You need to debug your app. You can use FMDB for all the sqlite purpose. It is very easier to use and very easy to manage.
Have you commited the changes in the DataBase?
Before you decide to use database (SQLite) , make sure you really need a database. If all you need is to persist data and retrive it back (and not querying) , try to do archiving / serialization. See Serialization vs. Archiving? for quick info on them
If your requirement is to have a database, #Rahul's suggestion is the best.