【问题标题】:Is there a way to remove all data about a user from Firebase?有没有办法从 Firebase 中删除有关用户的所有数据?
【发布时间】:2019-07-01 19:12:16
【问题描述】:

我在我的颤振应用程序中使用身份验证。为了重新创建情况,我从控制台中删除帐户并再次登录。但是,firebase 似乎记得我以前使用该帐户登录过(在身份验证中有一个 created on 字段)...是否可以从 firebase 中删除所有数据并登录,就好像 firebase 以前从未见过该帐户一样?

【问题讨论】:

  • 这是网页版还是安卓版还是ios版?
  • iOS 和安卓...
  • 您究竟观察到什么“记住”了用户的某些事情?
  • 您应该清除应用程序的缓存。您可以通过访问内部目录然后发出删除来做到这一点

标签: firebase firebase-authentication


【解决方案1】:

删除自己应用代码的缓存:

public static void deleteCache(Context context) {
    try {
        File dir = context.getCacheDir();
        deleteDir(dir);
    } catch (Exception e) { e.printStackTrace();}
}

public static boolean deleteDir(File dir) {
    if (dir != null && dir.isDirectory()) {
        String[] children = dir.list();
        for (int i = 0; i < children.length; i++) {
            boolean success = deleteDir(new File(dir, children[i]));
            if (!success) {
                return false;
            }
        }
        return dir.delete();
    } else if(dir!= null && dir.isFile()) {
        return dir.delete();
    } else {
        return false;
    }
}

【讨论】:

    猜你喜欢
    • 2020-07-22
    • 2015-05-29
    • 2019-08-15
    • 1970-01-01
    • 1970-01-01
    • 2019-08-13
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多