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.