U
U
UniProger2021-03-31 22:22:33
Unity
UniProger, 2021-03-31 22:22:33

Why isn't Unity Google Services working?

Greetings. I have an application written in Unity. Now it hangs in closed access in google play console. I'm trying to add a leaderboard there through this plugin: https://github.com/playgameservices/play-games-plu... I
put the plugin in the project, specified the resources and the identifier, but nothing happens when the application starts. I am using this code:

using UnityEngine;
using GooglePlayGames;
using GooglePlayGames.BasicApi;
using UnityEngine.SocialPlatforms;

public class GPSManager : MonoBehaviour
{
    [HideInInspector] private const string leaderBoard = "CorrectKey";
    void Start()
    {
        PlayGamesPlatform.Activate();
        Social.localUser.Authenticate((bool success) =>
        {
            if (success == true) { Debug.Log("Success!"); }
            else { Debug.Log("Nope!"); }
        });
    }

    public void ShowLeaderBoard()
    {
        Social.ReportScore(bestScoreGPS, leaderBoard, (bool success) => { });
        Social.ShowLeaderboardUI();
    }
}


The script itself hangs on the main camera. What could be the problem?
ShowLeaderBoard() - attached to the button, but when I press it, nothing happens
. In Unity, the script displays Nope

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question