- Home /
Question by
KidGamingFTW · Apr 22, 2018 at 05:19 AM ·
c#programminggoogle playservicegoogle-play-store
Google Play services not working
While building the game everything worked great, i could sign into play game services and see the leaderboards great! After i built it however and published the game it stopped working. Nothing was changed and the green sign in box doesnt even appear. For whatever reason though if i build the game in development mode the green box appears but doesnt sign in. I've tried both SHA-1 certificates and i published the game services also. The code im using is pretty standard:
using System.Collections;
using System.Collections.Generic;
using GooglePlayGames;
using GooglePlayGames.BasicApi;
using UnityEngine.UI;
using UnityEngine;
public class PlayGames_Events : MonoBehaviour {
public Text signInButtonText;
public GameObject LBButton;
void Start ()
{
//Create client configuration
PlayGamesClientConfiguration config = new PlayGamesClientConfiguration.Builder().Build();
//enable debugging
PlayGamesPlatform.DebugLogEnabled = true;
//Initialize and activate
PlayGamesPlatform.InitializeInstance(config);
PlayGamesPlatform.Activate();
//Silent Sign-In
PlayGamesPlatform.Instance.Authenticate(SignInCallBack, true);
}
private void Update()
{
LBButton.SetActive(Social.localUser.authenticated);
}
// signing in logic
public void SignIn ()
{
Debug.Log("sign in button clicked");
if (!PlayGamesPlatform.Instance.localUser.authenticated)
PlayGamesPlatform.Instance.Authenticate(SignInCallBack, false);
else
{
PlayGamesPlatform.Instance.SignOut();
signInButtonText.text = "Sign In";
}
}
public void SignInCallBack (bool success)
{
if (success) //success
{
signInButtonText.text = "sign out";
}
else //failure
{
signInButtonText.text = "sign in";
}
}
//leaderboards
public void ShowLeaderboards()
{
if (PlayGamesPlatform.Instance.localUser.authenticated)
PlayGamesPlatform.Instance.ShowLeaderboardUI();
}
}
I really need help ASAP please
Comment