1

I'm using Google Services for leaderboard in my game. It's not authenticate on start, should show leaderboard by clicking on button, but it's not showing anything. How I could solve it?

My authenticate script

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using GooglePlayGames;
using GooglePlayGames.BasicApi;
using UnityEngine.SocialPlatforms;


public class Auth : MonoBehaviour
{
    public static PlayGamesPlatform platform;

    private void Start() {
        if (platform == null) {
            PlayGamesClientConfiguration config = new PlayGamesClientConfiguration.Builder().Build();
            PlayGamesPlatform.InitializeInstance(config);
            PlayGamesPlatform.DebugLogEnabled = true;

            platform = PlayGamesPlatform.Activate();
        }

        Social.Active.localUser.Authenticate(succes => {
            if (succes) {
                Debug.Log("ENTER GOOGLE SERVICES");
            }
        });
    }
}

Leaderboard button script

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

public class Lead : MonoBehaviour
{
    private const string leaderboard = "Cg******";

    public void OpenLead() {
        Social.ReportScore(14, leaderboard, (bool succes) => {
            if (succes) {
                Debug.Log("SUCCESFUL ADDED");
            }
        });
        Social.ShowLeaderboardUI();
    }
}

I also saw a lot of this questions on the internet, but it's didn't help. I use latest play-games-plugin-for-unity, also tried

PlayGamesPlatform.Instance.ShowLeaderboardUI(leaderboard);

and

if ((((PlayGamesLocalUser) Social.localUser).Email != null) || (((PlayGamesLocalUser) Social.localUser).Email != ""))
derHugo
  • 83,094
  • 9
  • 75
  • 115
Wanheda
  • 71
  • 1
  • 8
  • use `logcat` to get the logs, there should be some errors on the logs. – AminSojoudi Sep 30 '19 at 07:53
  • I found this error in logcat: [Play Games Plugin DLL] 09/30/19 14:11:42 +03:00 DEBUG: Starting Auth Transition. Op: SIGN_IN status: ERROR_NOT_AUTHORIZED. How I could solve it? – Wanheda Sep 30 '19 at 11:29
  • Check these https://stackoverflow.com/questions/44153675/google-play-games-service-error-not-authorized-when-rollout-for-beta-unity3 and https://forum.unity.com/threads/google-play-games-sign-in-error_not_authorized-solved.433795/ – AminSojoudi Sep 30 '19 at 12:45

0 Answers0