- Home /
Cant sign in from my build to google play
I have integrated Google Play Services to my game and when I build the app, run it on my device, I cant log in to Google Play
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 ();
}
}
[1]: /storage/temp/78125-ss3.jpg
[2]: /storage/temp/78124-ss1.jpg
Your answer
Follow this Question
Related Questions
Google Game Services Not workng 0 Answers
Social.localUser.Authenticate((bool success) returns no bool 1 Answer
C# function continues without waiting for called Google Play method to complete 1 Answer
iOS Game Center & Android Game Center "Play Games" 1 Answer
Unable to convert classes into dex format, with no duplicate .jar files 0 Answers