playgameservices / play-games-plugin-for-unity

Google Play Games plugin for Unity
Other
3.46k stars 966 forks source link

All works well EXCEPT Social.Reportscore #2780

Closed Enosh15 closed 4 years ago

Enosh15 commented 4 years ago

Hi geniuses

i published an application and i m trying to update my app with Leaderboard Ranking System.

I changed my Oauth 2.0 into my App Signing Key, so that i could access to the leaderboard on my app, and also can open the UI for check the ranking.

HOWEVER, Mysteriously, i cant arrive to report my score! I ve waited during 2 days trying everything on google, but i cant find the reason.

Can you guys give an advice for me please?

ill attach my script below.

i added a lot of Debug logs for make it precise, but everything works well. I dont really get why i cant report my rank on it.....

(im testing the app at inner group, & alpha. Real app is on promotion now.) Please help me guys

readonly string[] leaderboardIdPerChapter = new string[6] { "(hidden)", "(hidden)", "(hidden)", "(hidden)", "(hidden)", "(hidden)" }; public void RankButtonClick() { Debug.Log("TEST1"); PlayGamesPlatform.Activate(); Social.localUser.Authenticate(AuthenticateHandler); Debug.Log("TEST2"); } public MarathonPopUI marathonPopUI;

void AuthenticateHandler(bool isSuccess)
{
    Debug.Log("TEST3");
    if (isSuccess)
    {
        Debug.Log("TEST4");
        int nowChap = VariableManager.LoadInstance().NowChapter;
        string leaderboardId = leaderboardIdPerChapter[nowChap - 1];
        float highScore = 0;
        switch (nowChap)
        {
            case 1:
                { highScore = MarathonManager.LoadInstance().RankChp1; }
                break;
            case 2:
                { highScore = MarathonManager.LoadInstance().RankChp2; }
                break;
            case 3:
                { highScore = MarathonManager.LoadInstance().RankChp3; }
                break;
            case 4:
                { highScore = MarathonManager.LoadInstance().RankChp4; }
                break;
            case 5:
                { highScore = MarathonManager.LoadInstance().RankChp5; }
                break;
            case 6:
                { highScore = MarathonManager.LoadInstance().RankChp6; }
                break;
        }
        Debug.Log("highscore1 : " + highScore);
        Social.ReportScore((long)highScore, leaderboardId, (bool success) =>
         {
             if (success)
             {
                 Debug.Log("TEST6");
                 Debug.Log("highscore2 : " + highScore);
                 PlayGamesPlatform.Instance.ShowLeaderboardUI(leaderboardId);
                 Debug.Log("TEST7");
             }
             else
             {
                 //upload hishscore failed
                 Debug.Log("highscore : failed");
                 marathonPopUI.NotReadyPopupFonction();
            }
         });
        Debug.Log("TEST5");
    }
}

(Filename: ./Runtime/Export/Debug.bindings.h Line: 45) 11-07 21:25:30.910 13697 13716 I Unity : 11-07 21:25:33.844 13697 13716 I Unity : TEST1 11-07 21:25:33.844 13697 13716 I Unity : LeaderboardManager:RankButtonClick() 11-07 21:25:33.844 13697 13716 I Unity : UnityEngine.Events.UnityEvent:Invoke() 11-07 21:25:33.844 13697 13716 I Unity : UnityEngine.EventSystems.ExecuteEvents:Execute(GameObject, BaseEventData, EventFunction1) 11-07 21:25:33.844 13697 13716 I Unity : UnityEngine.EventSystems.StandaloneInputModule:ProcessTouchPress(PointerEventData, Boolean, Boolean) 11-07 21:25:33.844 13697 13716 I Unity : UnityEngine.EventSystems.StandaloneInputModule:ProcessTouchEvents() 11-07 21:25:33.844 13697 13716 I Unity : UnityEngine.EventSystems.StandaloneInputModule:Process() 11-07 21:25:33.844 13697 13716 I Unity : 11-07 21:25:33.844 13697 13716 I Unity : (Filename: ./Runtime/Export/Debug.bindings.h Line: 45) 11-07 21:25:33.844 13697 13716 I Unity : 11-07 21:25:33.859 13697 13716 I Unity : Starting Auth with token client. 11-07 21:25:33.859 13697 13716 I Unity : GooglePlayGames.Native.NativeClient:Authenticate(Action2, Boolean) 11-07 21:25:33.859 13697 13716 I Unity : LeaderboardManager:RankButtonClick() 11-07 21:25:33.859 13697 13716 I Unity : UnityEngine.Events.UnityEvent:Invoke() 11-07 21:25:33.859 13697 13716 I Unity : UnityEngine.EventSystems.ExecuteEvents:Execute(GameObject, BaseEventData, EventFunction1) 11-07 21:25:33.859 13697 13716 I Unity : UnityEngine.EventSystems.StandaloneInputModule:ProcessTouchPress(PointerEventData, Boolean, Boolean) 11-07 21:25:33.859 13697 13716 I Unity : UnityEngine.EventSystems.StandaloneInputModule:ProcessTouchEvents() 11-07 21:25:33.859 13697 13716 I Unity : UnityEngine.EventSystems.StandaloneInputModule:Process() 11-07 21:25:33.859 13697 13716 I Unity : 11-07 21:25:33.859 13697 13716 I Unity : (Filename: ./Runtime/Export/Debug.bindings.h Line: 45) 11-07 21:25:33.859 13697 13716 I Unity : 11-07 21:25:33.867 13697 13716 I Unity : TEST2 11-07 21:25:33.867 13697 13716 I Unity : UnityEngine.Events.UnityEvent:Invoke() 11-07 21:25:33.867 13697 13716 I Unity : UnityEngine.EventSystems.ExecuteEvents:Execute(GameObject, BaseEventData, EventFunction1) 11-07 21:25:33.867 13697 13716 I Unity : UnityEngine.EventSystems.StandaloneInputModule:ProcessTouchPress(PointerEventData, Boolean, Boolean) 11-07 21:25:33.867 13697 13716 I Unity : UnityEngine.EventSystems.StandaloneInputModule:ProcessTouchEvents() 11-07 21:25:33.867 13697 13716 I Unity : UnityEngine.EventSystems.StandaloneInputModule:Process() 11-07 21:25:33.867 13697 13716 I Unity : 11-07 21:25:33.867 13697 13716 I Unity : (Filename: ./Runtime/Export/Debug.bindings.h Line: 45) 11-07 21:25:33.867 13697 13716 I Unity : 11-07 21:25:34.337 13697 13716 W Unity : !!! [Play Games Plugin DLL] 11/07/19 21:25:33 +01:00 WARNING: Creating new PlayGamesPlatform 11-07 21:25:34.337 13697 13716 W Unity : GooglePlayGames.OurUtils.PlayGamesHelperObject:Update() 11-07 21:25:34.337 13697 13716 W Unity : 11-07 21:25:34.337 13697 13716 W Unity : (Filename: ./Runtime/Export/Debug.bindings.h Line: 45) 11-07 21:25:34.337 13697 13716 W Unity : 11-07 21:25:34.655 13697 13997 I Unity : HandleRewardBasedVideoLoaded event received 11-07 21:25:34.655 13697 13997 I Unity : System.EventHandler1:Invoke(Object, TEventArgs) 11-07 21:25:34.655 13697 13997 I Unity : System.EventHandler1:Invoke(Object, TEventArgs) 11-07 21:25:34.655 13697 13997 I Unity : System.Reflection.MonoMethod:Invoke(Object, BindingFlags, Binder, Object[], CultureInfo) 11-07 21:25:34.655 13697 13997 I Unity : UnityEngine.AndroidJavaProxy:Invoke(String, Object[]) 11-07 21:25:34.655 13697 13997 I Unity : UnityEngine._AndroidJNIHelper:InvokeJavaProxyMethod(AndroidJavaProxy, IntPtr, IntPtr) 11-07 21:25:34.655 13697 13997 I Unity : 11-07 21:25:34.655 13697 13997 I Unity : (Filename: ./Runtime/Export/Debug.bindings.h Line: 45) 11-07 21:25:34.655 13697 13997 I Unity : 11-07 21:25:34.666 13697 13997 I Unity : HandleRewardBasedVideoLoaded event received 11-07 21:25:34.666 13697 13997 I Unity : System.EventHandler1:Invoke(Object, TEventArgs) 11-07 21:25:34.666 13697 13997 I Unity : System.EventHandler1:Invoke(Object, TEventArgs) 11-07 21:25:34.666 13697 13997 I Unity : System.Reflection.MonoMethod:Invoke(Object, BindingFlags, Binder, Object[], CultureInfo) 11-07 21:25:34.666 13697 13997 I Unity : UnityEngine.AndroidJavaProxy:Invoke(String, Object[]) 11-07 21:25:34.666 13697 13997 I Unity : UnityEngine._AndroidJNIHelper:InvokeJavaProxyMethod(AndroidJavaProxy, IntPtr, IntPtr) 11-07 21:25:34.666 13697 13997 I Unity : 11-07 21:25:34.666 13697 13997 I Unity : (Filename: ./Runtime/Export/Debug.bindings.h Line: 45) 11-07 21:25:34.666 13697 13997 I Unity : 11-07 21:25:34.877 13697 13697 I Unity : Building GPG services, implicitly attempts silent auth 11-07 21:25:34.877 13697 13697 I Unity : GooglePlayGames.Native.NativeClient:InitializeGameServices() 11-07 21:25:34.877 13697 13697 I Unity : GooglePlayGames.Native.<>cDisplayClass21_0:b__0(Int32) 11-07 21:25:34.877 13697 13697 I Unity : System.Reflection.MonoMethod:Invoke(Object, BindingFlags, Binder, Object[], CultureInfo) 11-07 21:25:34.877 13697 13697 I Unity : UnityEngine.AndroidJavaProxy:Invoke(String, Object[]) 11-07 21:25:34.877 13697 13697 I Unity : UnityEngine._AndroidJNIHelper:InvokeJavaProxyMethod(AndroidJavaProxy, IntPtr, IntPtr) 11-07 21:25:34.877 13697 13697 I Unity : 11-07 21:25:34.877 13697 13697 I Unity : (Filename: ./Runtime/Export/Debug.bindings.h Line: 45) 11-07 21:25:34.877 13697 13697 I Unity : 11-07 21:25:35.322 13697 13716 I Unity : TEST3 11-07 21:25:35.322 13697 13716 I Unity : LeaderboardManager:AuthenticateHandler(Boolean) 11-07 21:25:35.322 13697 13716 I Unity : GooglePlayGames.OurUtils.PlayGamesHelperObject:Update() 11-07 21:25:35.322 13697 13716 I Unity : 11-07 21:25:35.322 13697 13716 I Unity : (Filename: ./Runtime/Export/Debug.bindings.h Line: 45) 11-07 21:25:35.322 13697 13716 I Unity : 11-07 21:25:35.328 13697 13716 I Unity : TEST4 11-07 21:25:35.328 13697 13716 I Unity : LeaderboardManager:AuthenticateHandler(Boolean) 11-07 21:25:35.328 13697 13716 I Unity : GooglePlayGames.OurUtils.PlayGamesHelperObject:Update() 11-07 21:25:35.328 13697 13716 I Unity : 11-07 21:25:35.328 13697 13716 I Unity : (Filename: ./Runtime/Export/Debug.bindings.h Line: 45) 11-07 21:25:35.328 13697 13716 I Unity : 11-07 21:25:35.335 13697 13716 I Unity : highscore1 : 20 11-07 21:25:35.335 13697 13716 I Unity : LeaderboardManager:AuthenticateHandler(Boolean) 11-07 21:25:35.335 13697 13716 I Unity : GooglePlayGames.OurUtils.PlayGamesHelperObject:Update() 11-07 21:25:35.335 13697 13716 I Unity : 11-07 21:25:35.335 13697 13716 I Unity : (Filename: ./Runtime/Export/Debug.bindings.h Line: 45) 11-07 21:25:35.335 13697 13716 I Unity : 11-07 21:25:35.346 13697 13716 I Unity : TEST5 11-07 21:25:35.346 13697 13716 I Unity : LeaderboardManager:AuthenticateHandler(Boolean) 11-07 21:25:35.346 13697 13716 I Unity : GooglePlayGames.OurUtils.PlayGamesHelperObject:Update() 11-07 21:25:35.346 13697 13716 I Unity : 11-07 21:25:35.346 13697 13716 I Unity : (Filename: ./Runtime/Export/Debug.bindings.h Line: 45) 11-07 21:25:35.346 13697 13716 I Unity : 11-07 21:25:35.355 13697 13716 I Unity : TEST6 11-07 21:25:35.355 13697 13716 I Unity : <>cDisplayClass3_0:b0(Boolean) 11-07 21:25:35.355 13697 13716 I Unity : GooglePlayGames.OurUtils.PlayGamesHelperObject:Update() 11-07 21:25:35.355 13697 13716 I Unity : 11-07 21:25:35.355 13697 13716 I Unity : (Filename: ./Runtime/Export/Debug.bindings.h Line: 45) 11-07 21:25:35.355 13697 13716 I Unity : 11-07 21:25:35.359 13697 13716 I Unity : highscore2 : 20 11-07 21:25:35.359 13697 13716 I Unity : <>cDisplayClass3_0:b0(Boolean) 11-07 21:25:35.359 13697 13716 I Unity : GooglePlayGames.OurUtils.PlayGamesHelperObject:Update() 11-07 21:25:35.359 13697 13716 I Unity : 11-07 21:25:35.359 13697 13716 I Unity : (Filename: ./Runtime/Export/Debug.bindings.h Line: 45) 11-07 21:25:35.359 13697 13716 I Unity : 11-07 21:25:35.367 13697 13716 I Unity : TEST7 11-07 21:25:35.367 13697 13716 I Unity : <>cDisplayClass3_0:b__0(Boolean) 11-07 21:25:35.367 13697 13716 I Unity : GooglePlayGames.OurUtils.PlayGamesHelperObject:Update() 11-07 21:25:35.367 13697 13716 I Unity : 11-07 21:25:35.367 13697 13716 I Unity : (Filename: ./Runtime/Export/Debug.bindings.h Line: 45) 11-07 21:25:35.367 13697 13716 I Unity :

Enosh15 commented 4 years ago

[[!!Solved!!]] https://stackoverflow.com/a/54810162

<<In my case the problem got solved when I edited my GameServices profile and enabled the checkbox "Let others see your game activity".

Before that no matter what I did, all reported scores got ignored.>>

After found the simple solution, always i realise that i was stupid