[英]is UID in firebase automatically created/read for each user?
I'm sorry if my question is basic question...如果我的问题是基本问题,我很抱歉......
is UID in firebase automatically created when we implement .setUid()
at the first user sign-up account?当我们在第一个用户注册帐户中实施.setUid()
时,会自动创建 firebase 中的 UID 吗? and if we are login to that user account and implement .getUid()
, can we retrieve the same UID?如果我们登录到该用户帐户并执行.getUid()
,我们可以检索相同的 UID 吗?
I use Android Studio and Kotlin as programming language我使用 Android Studio 和 Kotlin 作为编程语言
No matter how you implement authentication on your app, firebase will automatically set a uid for each account created.无论您如何在您的应用程序上实现身份验证,firebase 都会自动为每个创建的帐户设置一个 uid。 If you go to the auth section of your firebase console and manually add an account, you will see on the right hand side a uid generated for that account.如果您 go 到您的 firebase 控制台的 auth 部分并手动添加一个帐户,您将在右侧看到为该帐户生成的 uid。
To reference this uid within your code the uid does not need to be stored in any database solution for the uid is attatched to the account within FirebaseAuth..要在您的代码中引用此 uid,uid 不需要存储在任何数据库解决方案中,因为 uid 已附加到 FirebaseAuth 中的帐户。
To pull the uid for reference once the user has signed in, first you need to set the auth global variable..要在用户登录后提取 uid 以供参考,首先需要设置 auth 全局变量。
private lateinit var auth: FirebaseAuth私人 lateinit var auth:FirebaseAuth
Then anywhere within the scope of your functions you can set your uid reference variable like this..然后在你的函数的 scope 中的任何地方你都可以像这样设置你的 uid 引用变量..
val myUid = FirebaseAuth.getInstance().currentUser.uid; val myUid = FirebaseAuth.getInstance().currentUser.uid;
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.