How to clear Firestore persistence data?

前端 未结 2 1260
甜味超标
甜味超标 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.

提交回复
热议问题