【发布时间】:2019-11-17 12:30:28
【问题描述】:
我已在我已发布的游戏“DontCross”中添加了排行榜,但当我提交分数时,排行榜显示“嗯,玩游戏中出了点问题”,并且“重试”按钮没有任何作用。
我从来没有在记分牌上显示任何形式的分数。
我检查了我的身份证,并在互联网上查找了类似的问题,但找不到解决方案。
我的游戏也有完美运行的成就,因此我与 Google Play 服务的连接不会成为问题。
提交代码:
Games.getLeaderboardsClient(this, GoogleSignIn.getLastSignedInAccount(this))
.submitScore(getString(R.string.leaderboard_scoreboard), (long)prefs.getInt(MyPreferences.LEVEL, 1));
用于显示排行榜:
Games.getLeaderboardsClient(this, GoogleSignIn.getLastSignedInAccount(this))
.getLeaderboardIntent(getString(R.string.leaderboard_scoreboard))
.addOnSuccessListener(intent -> startActivityForResult(intent, 9004));
我尝试过不发布和发布排行榜,并且我在网上查看了一些示例。
我真的不知道我做错了什么。 任何帮助将不胜感激! 谢谢
【问题讨论】:
-
developers.google.com/android/reference/com/google/android/gms/… 这里写着
It is required to call release() on this object or on the result of getScores() when finished with the LeaderboardScoreBuffer. -
@madlymad 感谢您的回答,但我不使用 LeaderboardscoreBuffer,所以我不知道该放在哪里?
标签: android google-play-services google-play-games leaderboard