При выборе аккаунта ничего не происходит. Не понимаю, на что он жалуется!?
Скрипт авторизации:
using UnityEngine;
using Google;
using Firebase.Auth;
using System.Threading.Tasks;
using Firebase.Extensions;
namespace Bonfire
{
public class GoogleAuth : OnClickButton_Base
{
[Header("Google API")]
[SerializeField] private string googleWebAPI;
[SerializeField] private TMPro.TextMeshProUGUI debug;
private GoogleSignInConfiguration _config;
private Firebase.DependencyStatus _dependencyStatus;
private FirebaseAuth _auth;
private FirebaseUser _user;
private void Awake()
{
_config = new GoogleSignInConfiguration
{
WebClientId = googleWebAPI,
RequestIdToken = true
};
}
protected override void Start()
{
base.Start();
_auth = FirebaseAuth.DefaultInstance;
}
protected override void AfterClick()
{
OnClickGoogleSingIn();
}
private void OnClickGoogleSingIn()
{
GoogleSignIn.Configuration = _config;
GoogleSignIn.Configuration.UseGameSignIn = false;
GoogleSignIn.Configuration.RequestIdToken = true;
GoogleSignIn.Configuration.RequestEmail = true;
GoogleSignIn.DefaultInstance.SignIn().ContinueWith(OnGoogleAuthFinished);
}
private void OnGoogleAuthFinished(Task<GoogleSignInUser> task)
{
if (task.IsFaulted)
{
Debug.LogError("Fault 1");
debug.text = "Fault 1" + task.Exception.ToString();
}
else if(task.IsCanceled)
{
Debug.LogError("Is Cancel 1");
}
else
{
Credential credential = GoogleAuthProvider.GetCredential(task.Result.IdToken, null);
_auth.SignInWithCredentialAsync(credential).ContinueWithOnMainThread(task =>
{
if(task.IsCanceled)
{
Debug.LogError("Is Cancel 2");
return;
}
if(task.IsFaulted)
{
Debug.LogError("Fault 2: ");
debug.text = "Fault 2" + task.Exception.ToString();
return;
}
if(task.IsCompleted)
{
_user = _auth.CurrentUser;
debug.text = "Complete" + _user.DisplayName;
}
});
}
}
}
}
Логи из LogCat