Firebase returns multiple IDs, Which is unique one?

前端 未结 1 1986
梦如初夏
梦如初夏 2020-12-11 19:24

I am new to Firebase and i am trying to connect Firebase Auth api into my application, I have followed documentation from newer updated documentation from Official site and

相关标签:
1条回答
  • 2020-12-11 19:40

    A user can sign in with multiple providers. Each provider generates its own unique ID for that user. You can access these under the user info for each provider.

    On top of that Firebase Authentication also generates its own unique ID for the user. No matter which provider the user signed in with, they'll end up with the same UID for that. You can find this under FirebaseUser.getUid().

    To identify a user, you'd normally use the value from FirebaseUser.getUid(), so in your snippet: user.getUid().

    0 讨论(0)
提交回复
热议问题