- Home /
Google Play services authentication issue
So I want my game to include a leader-board. I've followed all the steps re. setup in the dev. console and have imported the Unity Google play services package (0.9.42) into my project and again, followed the relevant setup.
The first issue I met was that after following these steps my APK wouldn't build as per an earlier issue I posted re. https://answers.unity.com/questions/1432252/google-play-games-integration-issue-commandinvokat.html
I got round this by following instructions from this link - https://answers.unity.com/questions/1201721/android-failed-to-re-package-resources.html and now can build as normal.
However, when running, the login fails (as per console message). I am using the following code :-
> void Start()
> {
> PlayGamesPlatform.Activate();
> Social.localUser.Authenticate((bool
> success) =>
> {
> if (success)
> {
> Debug.Log("Login Sucess");
> }
> else
> {
> Debug.Log("Login failed");
> }
> });
> }
Have hunted extensively for a solution but no joy.Any help would be greatly appreciated.
Try this
void Start ()
{
PlayGamesClientConfiguration config = new PlayGamesClientConfiguration.Builder ().Build ();
PlayGamesPlatform.InitializeInstance (config);
PlayGamesPlatform.DebugLogEnabled = true; // check logs
PlayGamesPlatform.Activate ();
Social.localUser.Authenticate (success => {
if (success) {
Debug.Log ("SignIn successful");
} else {
Debug.Log ("SignIn failed");
}
});
}
Have you set up correctly the GPGS Android Config. Another option was to see if the App sign is correct.