How to clear Firestore persistence data?

前端 未结 2 1259
甜味超标
甜味超标 2020-12-01 20:39

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

相关标签:
2条回答
  • 2020-12-01 21:32

    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.

    0 讨论(0)
  • 2020-12-01 21:40

    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.

    0 讨论(0)
提交回复
热议问题