Firebase Realtime Database data is coming even though it was deleted - firebase

I deleted data from Firebase even though realtime database data is coming in. I am using Firebase for Unity. I wonder if Unity Firebase SDK has a store of all data? If it so, how can I delete local Firebase Data?

Most likely the data is coming from the local disk cache, that Firebase may keep on Android/iOS devices if you enable it. If that is indeed the case, the simplest way to get rid of the data is to delete and reinstall the app.

Related

How to see which owner/contributor has deleted the Firestore data?

We are a team of developers working on an app for one and a half years, with the backend using Firebase and Firestore as cloud database. We have several owners and contributors to this project. Now our Firestore data and user authentication data have been deleted and we've lost almost everything. Is there a way to see which owner/contributor has deleted our data? And most importantly is there a way to retrieve this deleted data? Thanks in advance.
Note: We are on the Blaze (paid) plan of Firebase.
You can enable audit logs for Firestore to log all operations on the database to Cloud Logging and Cloud Monitoring. That way you can see exactly what happened. You have to opt-in to this though, so this will only help you see who did what after you enable it.
Currently there is no way to find out which collaborator on the project or which Authentication user deleted the data from Firestore.
If the data got deleted accidentally from your database,as Renaud Tarnec mentioned above in comment, you can reach out to Firebase support and ask for the data to be restored.
You can also check out Announcing Automated Daily Backups for the Firebase Database.

Flutter StreamBuilder shows Firebase data even when I'm offline

This is not a problematic question, it was asked because just wanted to know what's actually going on behind it, I can't find an answer in any documentation.
When i open the app without internet it shows the data from firebase, i try to restart then it also shows, i try to clear the cache but it shows the data like it shows from the local database, Why is this happening, is there a built-in local storage or something in Firebase Flutter?
Firestore SDKs cache any data that they've recently seen, as well as any pending writes from the local client that haven't been synchronized to the server yet. On mobile clients (iOS and Android) this cache is enabled by default, while on web you can enable it with an API call.
For more on this, see the Firebase documentation on accessing Firestore data while you're offline.

Under which circumstances does Firebase Firestore database get downloaded?

I'm creating an android app which uses Firebase Firestore database to store data. I store about 3600 questions and about 400 images. I know that firestore support offline. But I'm not sure whether the database download itself or not every time I request data from it. And under which circumstance does the firestore database get downloaded from the cloud? Does the database get only updated when the cloud database change?
Every query performed while the app is online will download all the necessary data from the database to satisfy that query.
Any data cached locally as a result of a prior query is only used when the app is offline. As suggested by the documentation, the idea is for your app to be usable when internet connectivity is interrupted. The assumption is that the connectivity will eventually come back, and queries will revert to using the online database as the primary source of data.

Testing firestore with disableNetwork [duplicate]

My iOS app's firestore cache seems to have got out of sync with Firestore. As a result I've had to disable persistence. Is there anyway to reset the cache? And is there a way to make sure it's constantly in sync? All I did was delete documents from the database!
There is now a feature in the API for clearing persistence. It is not recommended for anything but tests, but you can use
firebase.firestore().clearPersistence().catch(error => {
console.error('Could not enable persistence:', error.code);
})
It must run before the Firestore database is used.
There's no API for manipulating the local cache in any way. The Firestore SDK chooses what to store based on queries that you perform.
On Android, users can manually clear the local data for an app without uninstalling it. This will remove all the data locally stored by the app.
If you have a specific use case, please feel free to file a feature request.

how to enable persistance storage in firestore?

I am working on react-native with firestore and creating an offline application. The data should be stored in firestore when there is an healthy internet connection. If not, it should be stored in cache.
In firestore, there is an Enable offline data where the data can be stored offline. But, I didn't understand what and where exactly I've to write into that.
So anyone can help me out?
Thanks in advance
in your firebase file immediately after
firebase.initializeApp(firebbaseConfig)
firebase.firestore()
.enable persistence()
.catch(err => console.log(err)
The documentation for offline persistence states:
To use offline persistence, you don't need to make any changes to the
code that you use to access Cloud Firestore data. With offline
persistence enabled, the Cloud Firestore client library automatically
manages online and offline data access and synchronizes local data
when the device is back online.
So, you don't have to do anything to take this default behavior.
Firestore maintains copy of data locally, so even it writes data in offline and fetch it.
If you want to enable firestore persistence in your react native app, just copy paste the code from documentation to App.js, I am using the same and it is working fine.

Resources