M
M
Maxim Kapralov2018-04-21 15:44:07
Android
Maxim Kapralov, 2018-04-21 15:44:07

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
5adb305fd7115417523514.png
Game services are created, connected to the application, testers are added, services are published, the API project is associated
5adb308ed8c9c045268919.png
In the API management console, I already added both keys in the authorization data
5adb30d033348979234770.png
In Unity itself, the plugin is configured as in the guide
5adb31482c39f646790716.png
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)

Code
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();
    }
}

I just don’t even understand where the problem could be, my hands are already falling down and I want to quit this business

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
Denis Gaydak, 2018-04-21
@Byrnane

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 question

Ask a Question

731 491 924 answers to any question