Ive integrated Google Play services and built an APK. But when I install it on my device, and try to sign in, I get a failed report
using UnityEngine;
using System.Collections;
using GooglePlayGames;
using GooglePlayGames.BasicApi;
using UnityEngine.SocialPlatforms;
using System.Collections.Generic;
using UnityEngine.UI;
public class LBDemo : MonoBehaviour
{
public string leaderboard;
public Text loginText;
public Text leaderboardText;
public Text logoutText;
void Start ()
{
PlayGamesClientConfiguration config = new PlayGamesClientConfiguration ();
PlayGamesPlatform.InitializeInstance (config);
PlayGamesPlatform.Activate ();
PlayGamesPlatform.DebugLogEnabled = true;
logoutText.text = "initialized";
}
public void LogIn ()
{
Social.localUser.Authenticate ((bool success) =>
{
if (success) {
loginText.text = "Login success";
} else {
loginText.text = "Login failed";
}
});
}
public void OnShowLeaderBoard ()
{
if (Social.localUser.authenticated) {
Social.ShowLeaderboardUI (); // Show all leaderboard
//((PlayGamesPlatform)Social.Active).ShowLeaderboardUI (leaderboard); // Show current (Active) leaderboard
} else {
leaderboardText.text = "Login Failed";
}
}
public void OnAddScoreToLeaderBorad (long score)
{
if (Social.localUser.authenticated) {
Social.ReportScore (score, leaderboard, (bool success) =>
{
if (success) {
Debug.Log ("Update Score Success");
} else {
Debug.Log ("Update Score Fail");
}
});
}
}
public void OnLogOut ()
{
((PlayGamesPlatform)Social.Active).SignOut ();
}
}