Y
Y
Yura Mailler2021-04-20 17:43:08
Unity
Yura Mailler, 2021-04-20 17:43:08

Why might Google Play Services not work?

Hello ! I connect Google services to the game, but they do not work :(
what I did to connect:
1 - created a leaderboard in the console
2 - published the project in the configuration (the current writes that 3 out of 4 are completed and not crossed out, the current is "Add game services SDK Google Play to the APK file of the working version in order to use the API." . Maybe this is the problem, but I xs
3 - I installed a plug-in for connecting Google services in unity and wrote the code

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

[HideInInspector] private const string LeaderBoard = "CgkIrKzdppASEAIQAQ";

void Start()
    {
        //регистрация игрока
        PlayGamesPlatform.DebugLogEnabled = true;
        PlayGamesPlatform.Activate();
        Social.localUser.Authenticate(success =>
        {
            if (success)
            {

            }
            else
            {

            }
        });

    }

void Update {

//передаем число в доску лидеров
Social.ReportScore(TopScore, LeaderBoard, (bool success) => { });

}

//открытие доски лидеров
    public void OpenLeaderBoard()
    {
        Social.ShowLeaderboardUI();
        Debug.Log("Open Board");
    }
    //закрытие доски лидеров
    public void CloseLeaderBoard()
    {
        PlayGamesPlatform.Instance.SignOut();
    }

this is not all the code, I wrote the current that relates to services,

well, that's all.
(there was still registration in Google Cloud Platform)

Answer the question

In order to leave comments, you need to log in

1 answer(s)
G
GavriKos, 2021-04-20
@GavriKos

Well, at least you would have deduced the logs, what is there in authentication.
But 99% that you have not configured everything. Somewhere in the menus of the unit, the plugin setting should appear and there you still need to prescribe a pack of everything.
Well, in the update, pulling ReportScore is not good at all

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question