c# - 当用户在 C# 中使用电子邮件登录时如何获取用户 UID
问题描述
我想在用户在 C# 中成功登录后获取用户的 UID。
我正在尝试使用命令登录
auth.SignInWithEmailAndPasswordAsync()
它运行良好。但我想获取用户的 UID。请帮我。
解决方案
您可以执行以下操作来获取 uid:
auth.SignInWithEmailAndPasswordAsync(email, password).ContinueWith(task => {
if (task.IsCanceled) {
Debug.LogError("SignInWithEmailAndPasswordAsync was canceled.");
return;
}
if (task.IsFaulted) {
Debug.LogError("SignInWithEmailAndPasswordAsync encountered an error: " + task.Exception);
return;
}
Firebase.Auth.FirebaseUser newUser = task.Result;
Debug.LogFormat("User signed in successfully: {0} ({1})",
newUser.DisplayName, newUser.UserId);
});
检查文档:
推荐阅读
- confluent-schema-registry - 汇合模式注册表如何 http 发布 json-schema
- ios - 在催化剂程序中检测物理键盘按键
- php - 在电子邮件上获取 WooCommerce 订单日期时间
- javascript - 如何使小数在计算器 p5.js 中起作用
- c# - 尝试在.net core web api中实现分页时出现SqlException错误
- yaml - CloudFormation 提到架构版本 2.2 需要文档类型
- reactjs - 我将如何在 SPFX webpart 中对该 SP 列表进行排序?
- android - 使用firebase数据库在android studio中重置密码
- azure - 天蓝色 | 表单识别器预选文件?
- c++ - C++ 编译问题错误 - C2332: