Hi , I am currenty trying to implement Unity Authentication into my mobile game. Everything works fine for now , but the question is how to properly catch authentication errors. So my case is, when I call sign in, browser with unity login page appears, but when I force close it without entering any credentials, none of my try catches working. So basically I dont know if sign in worked or not, and since I am disabling sign in button on trigger, I cant enable sign in button back.
Here is my code :
private async void _SignInWithUnity()
{
//Remove last signed user data
_loggedUser.OnNext(null);
try
{
await AuthenticationService.Instance.SignInWithUnityAsync(PlayerAccountService.Instance.AccessToken);
Debug.Log("Signed in with Unity");
var pi = AuthenticationService.Instance.PlayerInfo;
_loggedUser.OnNext(pi);
}
catch (AuthenticationException ex)
{
Debug.Log("AuthenticationException");
Debug.LogException(ex);
}
catch (RequestFailedException ex)
{
Debug.Log("RequestFailedException");
Debug.LogException(ex);
}
}