Google play games services plugin can't log in
It's been one week I'm trying to implement googe play games services plugin, I've tested multiple versions of the plugin always on unity 2018.4.11.f1
Plugin git page: https://github.com/playgameservices/play-games-plugin-for-unity
.
My code implementation is pretty much what is in the git page.
First this on start:
void Start()
{
loginButton.onClick.AddListener(() => onClickLogin());
PlayGamesClientConfiguration config = new PlayGamesClientConfiguration.Builder()
// enables saving game progress.
//.EnableSavedGames()
// requests the email address of the player be available.
// Will bring up a prompt for consent.
.RequestEmail()
// requests a server auth code be generated so it can be passed to an
// associated back end server application and exchanged for an OAuth token.
.RequestServerAuthCode(false)
// requests an ID token be generated. This OAuth token can be used to
// identify the player to other services such as Firebase.
.RequestIdToken()
.Build();
PlayGamesPlatform.InitializeInstance(config);
// recommended for debugging:
PlayGamesPlatform.DebugLogEnabled = true;
// Activate the Google Play Games platform
PlayGamesPlatform.Activate();
}
.
Then, this onClick function:
private void onClickLogin()
{
Social.localUser.Authenticate((bool success) =>
{
if (success)
{
feedbackText.text = "succes";
}
else
{
feedbackText.text = "fail";
}
});
}
.
I verified my game package. It is the same in:
Google play console.
Google dev console.
Unity plugin setup page.
It's "com.uwniagames.dashtail".
.
I verified that I used the SINGING SHA1 certificate from google play console to register the app at google dev console.
.
My OAuth is also the same in the both google consoles and in the Unity plugin's setup.
.
Finally this is my configuration for target architecture, not sure if this is meaningful.
.
I used Android Device Monitor to find out the log and I only get this error:
03-19 14:22:36.126: W/GameHelper(15312): ****
03-19 14:22:36.126: W/GameHelper(15312): ****
03-19 14:22:36.126: W/GameHelper(15312): **** APP NOT CORRECTLY CONFIGURED TO USE GOOGLE PLAY GAME SERVICES
03-19 14:22:36.126: W/GameHelper(15312): **** This is usually caused by one of these reasons:
03-19 14:22:36.126: W/GameHelper(15312): **** (1) Your package name and certificate fingerprint do not match
03-19 14:22:36.126: W/GameHelper(15312): **** the client ID you registered in Developer Console.
03-19 14:22:36.126: W/GameHelper(15312): **** (2) Your App ID was incorrectly entered.
03-19 14:22:36.126: W/GameHelper(15312): **** (3) Your game settings have not been published and you are
03-19 14:22:36.126: W/GameHelper(15312): **** trying to log in with an account that is not listed as
03-19 14:22:36.126: W/GameHelper(15312): **** a test account.
.
Additional Information:
I tested with build and run and also uploading to google and downloading in my device.
I am registered as a beta tester but I also tryed releasing to production.
My app is only available for Brazil for now.
.
After a week reading and testing every possibility I'm really close to giving up and using something else to login and save player data, this post is my final shot, I really appreciate any help, thank you.
ps: "EnableSavedGames" is comment because I read some people had problems logging in when it's enable, I'm testing it now.
Answer by Jadara · Jan 03, 2020 at 11:12 PM
If you haven't solved this yet. Try removing things such as '.RequestServerAuthCode(false)' from config until it works. Or if you need it try setting up google play with your OAuth2 Client ID.
Thank you!!! Just commenting out the line .RequestServerAuthCode(false) really helped. After hours i finally get at least a popup in my app and can continue.