Question by
Jul8910 · Jul 09, 2018 at 12:57 PM ·
unity 5google playgoogle play gamesunity 4
Google Play Services Login isn't working
Hey,
I implemented the Google Play Services into my Unity Project. But if I want to run on my physical android device, the user hadn't been logged in. I don't know what I'm doing wrong but I'm really desperate now.
This is my code:
using GooglePlayGames;
using GooglePlayGames.BasicApi;
using UnityEngine;
using UnityEngine.UI;
public class GooglePlayManager : MonoBehaviour {
public Text txtGPSinfo;
public Button btnSignIn;
// Use this for initialization
void Start () {
PlayGamesClientConfiguration config = new PlayGamesClientConfiguration.Builder().Build();
PlayGamesPlatform.InitializeInstance(config);
PlayGamesPlatform.Activate();
btnSignIn.onClick.AddListener(delegate
{
txtGPSinfo.text = "calling SignIn Method.";
SignIn();
});
}
void SignIn()
{
txtGPSinfo.text = "trying to sign in..."; // stucks here: this is the text which is only shown
Social.localUser.Authenticate(success => {
txtGPSinfo.text = "success: " + success;
});
if (Social.localUser.authenticated == true)
{
txtGPSinfo.text = "User is already authenticated!";
}
}
//...
It looks like it stucks here: Social.localUser.Authenticate(success => {
because my info text just shows
trying to sign in...
.
Thank you very much for any help!
Comment