How to clear Firestore persistence data?

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.