What happens to Firebase anonymous users?

前端 未结 3 1572
囚心锁ツ
囚心锁ツ 2020-12-08 06:33

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

The Firebase documentation is really BAD and didn\'t explain ev

3条回答
  •  伪装坚强ぢ
    2020-12-08 07:07

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

    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) Admin SDK & Firebase CLI list users.

    2) Linking multiple auth providers

    3) Auth State Persistence

    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.

    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.

    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.

提交回复
热议问题