如何清除Firebase缓存? [英] How to clear firebase cache?

查看:180
本文介绍了如何清除Firebase缓存?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我遇到一个问题,当我注销用户(使用 FirebaseAuth.signOut()方法)并与其他用户登录时,前一个用户的信息

I'm facing an issue where when I sign out a user (using FirebaseAuth.signOut() method) and sign in with another user, information of the previous user are loaded instead of the new one.

我相信这是由于此信息仍可在Firebase的缓存中访问造成的。

I believe this is caused by this information still being accessible in firebase's cache.

有没有办法强制Firebase清除其本地缓存?

Is there a way to force firebase to clear its local cache?

干杯!

推荐答案

对于Android,有 FirebaseFirestore.clearPersistence()

For Android, there is FirebaseFirestore.clearPersistence().

对于JavaScript / web,有 Firebase.clearPersistence()

For JavaScript/web, there is Firebase.clearPersistence().

对于iOS,有 Firebase.clearPersistence()

Flutter似乎不会

Flutter does not seem to have this API yet.

请记住,clearPersistence API并不适合您正在谈论的特定情况。如果您仔细阅读API文档,您会发现它们是用于测试的。

Bear in mind that the clearPersistence API is not meant for the specific case you're talking about. If you read the API docs carefully, you can see they're meant for testing.

您可能需要做更多的调试工作才能弄清楚到底是什么无法按照您期望的方式工作。由于您没有显示任何代码,因此很难确定您做错了什么。

You might want to do a little more debugging to figure out what exactly it is that's not working the way you expect. Since you're not showing any code, it's hard to tell if you might be doing something wrong.

这篇关于如何清除Firebase缓存?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆