【发布时间】:2018-06-13 20:06:25
【问题描述】:
在正在开发的 Xamarin Forms 应用程序中遇到 Firebase 身份验证问题。尝试使用以下方式登录时:
界面:
public interface IFirebaseAuthenticator
{
Task<string> LoginWithEmailPassword(string email, string password);
}
类:
public class FirebaseAuthenticator : IFirebaseAuthenticator
{
public async Task<string> LoginWithEmailPassword(string email, string password)
{
IAuthResult user = await FirebaseAuth.Instance.SignInWithEmailAndPasswordAsync(email, password);
var token = await user.User.GetIdTokenAsync(false);
return token.Token;
该函数在应用程序的 MainActivity.cs 文件中被调用。我们确实安装并引用了 Xamarin.Firebase.Auth Nuget 包。
没有返回任何内容,错误文档也没有任何帮助。我们的团队几乎浏览了我们可以在网上找到的所有信息,并在不得已的情况下才在此处发布。
感谢您的帮助。
【问题讨论】:
-
当你说什么都不返回。你的意思是用户为空?
标签: c# firebase xamarin xamarin.forms firebase-authentication