Firebase 匿名用户会怎样? [英] What happens to Firebase anonymous users?

查看:16
本文介绍了Firebase 匿名用户会怎样?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想知道我使用匿名登录方法的应用用户会发生什么.

I want to know what will happen to the users of my app that I used anonymous sign in method for them.

Firebase 文档真的很糟糕,并没有解释所有内容,并希望开发人员自己找出答案.我在其旧版本文档中发现匿名会话将根据 Login & 中设置的到期时间到期.Auth 选项卡,但即使没有提到这也意味着会话结束,或者这意味着用户 ID 也会从我的应用用户列表中删除,或者究竟发生了什么?

The Firebase documentation is really BAD and didn't explain everything and expect developer to find out himself. I found in its old version documentation that anonymous session will expires based on the expiration time has been set in Login & Auth tab, but even there didn't mention this means just the session ends or it means that user id will remove also from my app users list or what EXACTLY happened?

我找到了这个答案,但这确实是不可接受的.如果你做一个网络应用程序并且让每件事都变得困难,匿名用户的数量会增长得非常快.我什至在我的仪表板中看不到我的应用程序用户数量!!!!!所以我该怎么做?我应该自己为我的数据开发仪表板还是 Firebase 团队应该这样做?至少对于管理用户而言,我应该拥有更多的权力,而不仅仅是使用他们的电子邮件搜索用户,而且当您使用自定义登录时,您也不能这样做.

I found this answer but it really is not acceptable. The number of anonymous users will grow very very fast if you do a web app and make every thing hard. I even cannot see the number of my app users in my dashboard!!!!! So, what should i do? should i develop a dashboard for my data myself or Firebase team should do it? At least for managing users i should have more power than just searching user with their email and when you use custom login you cannot do this also.

推荐答案

匿名用户不会过期,目前还没有任何自动清除它们的方法.

Anonymous users don't expire, and there isn't currently any automated way to purge them.

Firebase 不会自动删除它们,因为它真的不知道用户是否仍在存储链接到该登录名的数据 - 只有应用程序创建者知道.想象一下,如果您在手机上玩益智游戏,并达到 100 级.然后当您明年玩 101 级时,所有进度都将丢失.Firebase 不能仅仅假设用户一年不活动就意味着可以删除该帐户.

Firebase doesn't automatically remove them because it doesn't really know if a user is still storing data linked to that login - only the app creator does. Imagine if you are playing a puzzle game on your phone, and get to level 100. Then when you go to play level 101 next year, all progress is lost. Firebase can't just assume a user being inactive for a year means that the account can be removed.

不过,有一些工具应该会有所帮助.

There is a couple tools that should help, though.

1) 管理 SDK &Firebase CLI 列出用户.

1) Admin SDK & Firebase CLI list users.

2) 链接多个身份验证提供商

3) 身份验证状态持久性

列出您的用户后,您可以检查每个用户是否有任何其他提供者,最近没有使用过,没有存储数据,以及 删除它们.

Once you list your users, you can check that each doesn't have any other providers, and hasn't been used recently, doesn't have data stored, and delete them.

不过,最好确保每个用户只创建一个帐户.如果您创建匿名帐户以帮助用户在登录前存储数据,您可能需要考虑提示他们链接身份验证提供商(如 Google 或电子邮件).如果您关联该帐户,而不是创建一个新帐户,您就可以避免活跃用户放弃帐户.

Better, though, would be to ensure that only one account is created per user. If you create an anonymous account to help users store data before logging in, you may want to consider prompting them to link a auth provider (like Google or email). If you link the account, rather than creating a new one, you'll avoid abandoned accounts from active users.

通常,您还需要确保使用身份验证状态持久性来确保创建的帐户数量不会超过所需数量.为每位新访问者创建 1 个帐户,而不是每次有人重复访问您的页面时创建 1 个帐户,这将极大地有助于控制用户增长.

In general, you will also want to make sure to use auth state persistence to ensure that there aren't more accounts than necessary being created. Creating 1 account per new visitor, rather than 1 per time someone repeatedly visits your page, will significantly help keep user growth in check.

这篇关于Firebase 匿名用户会怎样?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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