Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How many time Anonymous users are created in Firebase

I would like to use the signInAnonymously feature from firebase but I'd like to know how it works exactly.

  • Is this anonymous user added as any other user in Firebase (but without an email or password) ?
  • Is it automatically removed after a certain time ?
  • If I call this method on each app launch. Will it create a new user everytime ? How will it know how te reuse an old one ? Local Storage ?
  • So will it create another user in database if my users connects from another device ?

Thanks a lot

like image 470
Maslow Avatar asked Nov 22 '16 12:11

Maslow


People also ask

What is anonymous user in Firebase?

You can use Firebase Authentication to create and use temporary anonymous accounts to authenticate with Firebase. These temporary anonymous accounts can be used to allow users who haven't yet signed up to your app to work with data protected by security rules.

How long is a Firebase user logged in for?

Firebase ID tokens are short lived and last for an hour; the refresh token can be used to retrieve new ID tokens. Refresh tokens expire only when one of the following occurs: The user is deleted. The user is disabled.


1 Answers

  • An anonymous user account is similar to any other user account in Firebase, except that there is no way to identify the user.

  • Anonymous users are not automatically removed.

  • Each time you call the API to create an anonymous user, a new account will be created. To re-use the existing account, you should listen for the auth state when the app starts and only create a new user account if the user isn't signed in yet.

  • If the same (anonymous) user signs in from multiple devices, they will get a separate account on each. If that is not what you want for your use-case, you should require one of the identified authentication methods (email/password, Facebook, Google, etc)/

like image 82
Frank van Puffelen Avatar answered Oct 02 '22 12:10

Frank van Puffelen