Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice
  3. Join us on November 16th, 2023, between 1 pm and 9 pm CET for Ask the Experts Online on Discord and on Unity Discussions.
    Dismiss Notice

Stuck on loading Leaderboards

Discussion in 'Android' started by Rilissimo, Nov 11, 2015.

  1. Rilissimo

    Rilissimo

    Joined:
    Mar 10, 2015
    Posts:
    13
    Hi all! i have a small issue when i try to loading the leaderboards on my app, it just stuck on loading when show up. the user login and adding achievements works fine, just when i trying to load leaderboards it stuck, thats my code for login:

    Code (CSharp):
    1.  
    2. public class LogIn : MonoBehaviour {
    3.  
    4.      public void Awake () {
    5.         DontDestroyOnLoad (gameObject);
    6.         PlayGamesPlatform.Activate();
    7.        
    8.         Social.localUser.Authenticate((bool success) => {
    9.              if (success) {
    10.                  Debug.Log("You've successfully logged in");
    11.                 Application.LoadLevel("mainMenu");
    12.              } else {
    13.                  Debug.Log("Login failed for some reason");
    14.                  Application.Quit();
    15.              }
    16.          });
    17.  
    18.          PlayGamesClientConfiguration config = new PlayGamesClientConfiguration.Builder()
    19.            
    20.              .Build();
    21.        
    22.          PlayGamesPlatform.InitializeInstance(config);
    23.  
    24.          PlayGamesPlatform.DebugLogEnabled = true;
    25.        
    26.      }
    27. }
    28.  
    and this is my code for trying loading leaderboards:

    Code (CSharp):
    1. public class LeaderBoardManager : MonoBehaviour {
    2.  
    3.     public void LeaderBoard () {
    4.          PlayGamesPlatform.Activate();
    5.         PlayGamesPlatform.Instance.ShowLeaderboardUI("CgkI15nOqsIaEAIQAQ");
    6.      }
    7.  
    8.      public void addScore(){
    9.          PlayGamesPlatform.Activate();
    10.         if (Social.localUser.authenticated){
    11.             long score;
    12.             score = Random.Range(2500,5000);
    13.             Social.ReportScore(score, "CgkI15nOqsIaEAIQAQ", (bool success) =>{
    14.                 if (success){
    15.                 ((PlayGamesPlatform)Social.Active).ShowLeaderboardUI("CgkI15nOqsIaEAIQAQ");
    16.                 }else{
    17.            
    18.                     Debug.Log("Add Score Fail");
    19.                     }
    20.                 });
    21.             }
    22.         }
    23.  
    24.     public void getAchi(){
    25.         if (Social.localUser.authenticated){        
    26.             Social.ReportProgress("CgkI0NbOnbcKEAIQAg", 100.0f, (bool success) => {
    27.                 if(success){
    28.                     ((PlayGamesPlatform)Social.Active).ShowAchievementsUI();
    29.                 }
    30.             });
    31.         }
    32.     }
     
    Last edited: Nov 11, 2015
  2. Rilissimo

    Rilissimo

    Joined:
    Mar 10, 2015
    Posts:
    13