问题
I have enabled google play games plugin in my Unity Project. The Unity version is 5.3.4f1. The google play games plugin version is 0.9.32. I have successfully logged in to the google play games service in my project. After submitting the score,and when I try to view the leaderboard, its showing an error like this in the log:
04-29 09:58:53.537: I/Unity(6910): [Play Games Plugin DLL] 04/29/16 9:58:53 +05:30 DEBUG: Entering internal callback for AndroidPlatformConfiguration#InternalIntentHandler
04-29 09:58:53.537: I/Unity(6910): (Filename: ./artifacts/generated/common/runtime/UnityEngineDebugBindings.gen.cpp Line: 37)
04-29 09:58:53.575: I/Unity(6910): [Play Games Plugin DLL] 04/29/16 9:58:53 +05:30 DEBUG: Application is pausing, which disconnects the RTMP client. Leaving room.
04-29 09:58:53.575: I/Unity(6910): (Filename: ./artifacts/generated/common/runtime/UnityEngineDebugBindings.gen.cpp Line: 37)
04-29 09:58:55.940: D/GamesUnitySDK(6910): Forwarding OnActivityResult
04-29 09:58:55.963: D/GamesUnitySDK(6910): Forwarding OnActivityResult Finished
04-29 09:58:55.999: I/Unity(6910): [Play Games Plugin DLL] 04/29/16 9:58:55 +05:30 DEBUG: Showing UI Internal callback: ERROR_NOT_AUTHORIZED
04-29 09:58:55.999: I/Unity(6910): (Filename: ./artifacts/generated/common/runtime/UnityEngineDebugBindings.gen.cpp Line: 37)
04-29 09:58:56.077: I/Unity(6910): [Play Games Plugin DLL] 04/29/16 9:58:56 +05:30 DEBUG: Invoking user callback on game thread
04-29 09:58:56.077: I/Unity(6910): (Filename: ./artifacts/generated/common/runtime/UnityEngineDebugBindings.gen.cpp Line: 37)
04-29 09:58:56.085: I/Unity(6910): [Play Games Plugin DLL] 04/29/16 9:58:56 +05:30 DEBUG: Received UI callback: ERROR_NOT_AUTHORIZED
04-29 09:58:56.085: I/Unity(6910): (Filename: ./artifacts/generated/common/runtime/UnityEngineDebugBindings.gen.cpp Line: 37)
04-29 09:59:54.185: I/Unity(6910): [Play Games Plugin DLL] 04/29/16 9:59:54 +05:30 DEBUG: Application is pausing, which disconnects the RTMP client. Leaving room.
04-29 09:59:54.185: I/Unity(6910): (Filename: ./artifacts/generated/common/runtime/UnityEngineDebugBindings.gen.cpp Line: 37)
I'm getting an error like this
DEBUG: Received UI callback: ERROR_NOT_AUTHORIZED
I have successfully login also, but still its showing as Error not authorized. Here is my code.
using GooglePlayGames;
using GooglePlayGames.BasicApi;
public class GooglePlayGameService : MonoBehaviour {
void Start()
{
PlayGamesClientConfiguration config = new PlayGamesClientConfiguration.Builder()
.RequireGooglePlus()
.Build();
PlayGamesPlatform.InitializeInstance(config);
PlayGamesPlatform.DebugLogEnabled = true;
PlayGamesPlatform.Activate();
Social.localUser.Authenticate((bool Success)=>{
if(Success)
{
mStatusText = "Welcome " + Social.localUser.userName;
Debug.Log("Success Google Play Games");
}
else
{
mStatusText = "Authentication failed.";
//ShowNextScene ();
Debug.Log("failed Google Play Games");
}
});
}
}
public void ShowScoreBoard()
{
Debug.Log("User Authenticated: " + Social.localUser.authenticated);
if (Social.localUser.authenticated)
((PlayGamesPlatform)Social.Active).ShowLeaderboardUI("leaderboard id here");
}
When I check whether the user is authenticated or not, it is returning true, when I debug it. But the leaderboard is not showing up. can some one please help me in solving this error. Thanks in advance.
回答1:
if EnableSavedGames() is used in the Builder(), then you'll need to toggle on SavedGames support in the Developer Console and also enable Drive API in the "API Console Project". The place to reach all of this would be the "Game Details" page in the Developer Console.
make sure you dont have multiple debug.keystore
on your computer
and your SHA1 on the Developer Console and build should be the same
来源:https://stackoverflow.com/questions/36933159/google-play-leaderboard-not-showing-up-after-posting-score-to-leaderboard-in-uni