2

User authentication doesn't work in my app that I'm making for android. This is the script that is attached to an empty game object in my main menu.

void Start()
{

    PlayGamesPlatform.Activate();
    PlayGamesPlatform.DebugLogEnabled = true;

}

public void LoadScene(string sceneName)
{
    SceneManager.LoadScene(sceneName);
}

public void showleaderboard()
{
    if(Social.localUser.authenticated)
    {
        PlayGamesPlatform.Instance.ShowLeaderboardUI("CgkIq82p4qcNEAIQAQ");
    }
    else
    {
        Debug.Log("leaderboard not working");
    }
}

public void userlogin()
{
    Social.localUser.Authenticate((bool success) => 
    {
        if(success)
        {
            Debug.Log("Logged in");
        }
        else
        {
            Debug.Log("Login failed");
        }
    });
}

The functions are attached to buttons and I always get the log "Login Failed" in my console. I tested this on an android device that was able to log into google play services in other published apps.

sakurashards
  • 37
  • 1
  • 6

1 Answers1

0

You should add your account as test account in Google play services panel, otherwise it will be always a failed login.

AminSojoudi
  • 1,904
  • 2
  • 18
  • 42