Answer the question
In order to leave comments, you need to log in
Google Play Games services not working?
Good time everyone! Guys, you are my last hope. I just can’t get GPG services to work in an android game on Unity, I’ve already tried everything that is possible. The problem is that stupidly nothing happens, the authorization window does not even appear. In the debug mode, a couple of messages from the plugin are displayed in the console without errors, the last message is Creating Android IPlayGamesClient Client , and then everything, just silence. Below are screenshots and code snippets.
The application is uploaded to the GP and signed
Game services are created, connected to the application, testers are added, services are published, the API project is associated
In the API management console, I already added both keys in the authorization data
In Unity itself, the plugin is configured as in the guide
Activation and authorization code, everything is as in the official guide. The authorization callback does not work at all (on the phone, when launched in a yunk, it normally gives an authorization error)
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using GooglePlayGames;
using UnityEngine.SocialPlatforms;
using GooglePlayGames.BasicApi;
public class MenuController : MonoBehaviour {
public void Start ()
{
Debug.Log("activate");
PlayGamesClientConfiguration config = new PlayGamesClientConfiguration.Builder()
.EnableSavedGames()
.RequestEmail()
.RequestServerAuthCode(false)
.RequestIdToken()
.Build();
PlayGamesPlatform.InitializeInstance(config);
PlayGamesPlatform.DebugLogEnabled = true;
PlayGamesPlatform.Activate();
}
public void LogIn()
{
Debug.Log("login");
Social.localUser.Authenticate((bool success) =>
{
if (success)
{
Debug.Log("Login Sucess");
}
else
{
Debug.Log("Login failed");
}
});
}
public void OnShowLeaderBoard()
{
Debug.Log("lb");
Social.ShowAchievementsUI();
}
}
Answer the question
In order to leave comments, you need to log in
Well. basically everything is correct. the only question is .. do you collect the application signed for publication in the store?
and on the device where are you testing which user in google play games?
is this user added to the testers so that he can use the services before publishing the application in the store?)
well, they also have bugs from time to time in all these additional functions
.EnableSavedGames()
.RequestEmail()
.RequestServerAuthCode(false)
.RequestIdToken()
. build();
try the simplest option first. just to authorize. just Build
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question