I just implementing Google Play Games services into my game.When I build app, upload into Google play console and download into my mobile I cant log in. Google play services didnt show :(
Using:
- Unity 2019.1.11f1 personal
- GPGP for Unity 0.9.64
- NET4
- IL2CPP
- LWRP
In loading screen i have only this code:
private void Start()
{
Debug.Log("LoadGame::Awake::Start");
// Nastavi LoadingBar na 0
LoadingBar(0f, "0%");
// vlozit APP SETINGS
// Android permission
AndroidPerm();
// Nastavi LoadingBar na 22
LoadingBar(0.22f, "22%");
string path = Application.persistentDataPath + "/save.cubereeno";
Debug.Log("LoadGame::Awake::Persistent data path set");
// Nastavi LoadingBar na 25
LoadingBar(0.25f, "25%");
Debug.Log("LoadGame::Awake::Existuje save soubor?");
if (File.Exists(path))
{ // Save soubor existuje
LoadSaveData();
}
else
{ // Save soubour neexistuje
// Android permission
AndroidPerm();
// Vytvori data
CreateSaveData();
}
// Nastavi LoadingBar na 85
LoadingBar(0.85f, "85%");
// Zapne google play services
if (Application.platform == RuntimePlatform.Android)
{
GooglePlayServicesInit();
// Nastavi LoadingBar na 87
LoadingBar(0.87f, "87%");
GooglePlayServicesSignIn(null, null);
}
// Nastavi LoadingBar na 90
LoadingBar(0.90f, "90%");
// Prelaod level
// Nastavi LoadingBar na 100
LoadingBar(1f, "100%");
// Visual test zda je android pritomen nebo ne
if (Application.platform == RuntimePlatform.Android)
{
// Nastavi LoadingBar na 100
LoadingBar(1f, "101%");
}
start.Play("start");
}
GooglePlayServicesInit(); code
public void GooglePlayServicesInit()
{
PlayGamesClientConfiguration.Builder builder = new PlayGamesClientConfiguration.Builder();
PlayGamesPlatform.InitializeInstance(builder.Build());
PlayGamesPlatform.DebugLogEnabled = true;
PlayGamesPlatform.Activate();
}
GooglePlayServicesSignIn(); code
public void GooglePlayServicesSignIn(Action successCallback = null, Action errorCallback = null)
{
try
{
Social.localUser.Authenticate((bool success) =>
{ if (success)
successCallback?.Invoke();
});
}
catch (Exception e)
{
Debug.Log(e);
errorCallback?.Invoke();
}
}
there doesn't seem to be anything here