本文介绍了如何打开“全部”默认情况下,而不是“社交”在谷歌排行榜?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在Android游戏应用中整合了谷歌排行榜。当我打开它时,它会默认进入社交模式(也就是我的Google圈子)。我需要手动切换到全部模式(来自世界各地的玩家)。如何使全部模式默认?

解决方案

基于谷歌文档,克莱顿的下面答案看起来很完美。
但是我认为google文档和Leaderboard类是不匹配的。



如果您尝试:Games.Leaderboards.getLeaderboardIntent(GoogleApiClient apiClient,String leaderboardId)如果你尝试:Games.Leaderboards.getLeaderboardIntent(GoogleApiClient apiClient,String leaderboardId,int timeSpan)它的工作原理,但无论你的int值是什么,你都会有一个排行榜如果你尝试(应该是你的anwser):Games.Leaderboards.getLeaderboardIntent(GoogleApiClient apiClient,字符串leaderboardId,int timeSpan,int集合)它(该方法不存在)。



为了说明我的意思是不存在,你可以看看我们应该做什么排行榜类(49至51行):



另一个关于Stackoverflow的问题也是关于这个问题的:



顺便说一句,我们希望它很快就会被纠正(或者我错了某处)!

I have integrated Google Leaderboard in my android game app. When I open it, it goes to "Social" mode by default (aka my Google circle). I need to manually switch to "All" mode (players from all around the world). How can I make "All" mode default?

解决方案

Based on google documentation the below answer from Clayton looks perfect.However I think there is a mismatch between google documentation and Leaderboard class.

If you try : Games.Leaderboards.getLeaderboardIntent(GoogleApiClient apiClient, String leaderboardId) it works.

If you try : Games.Leaderboards.getLeaderboardIntent(GoogleApiClient apiClient, String leaderboardId, int timeSpan) it works but whatever the int value you will have an Leaderboard on "All time" based.

If you try (what should be your anwser): Games.Leaderboards.getLeaderboardIntent(GoogleApiClient apiClient, String leaderboardId, int timeSpan, int collection) it doesn't work (the method doesn't exist).

To illustrate what I mean by "doesn't exist" you can have a look at what should be our Leaderboard class (lines between 49 and 51) :https://github.com/gamea-fiks/ccc/blob/62156a697da41733afb23a63beed05e3b17a5784/sources/com/google/android/gms/games/leaderboard/Leaderboards.java

Another question on Stackoverflow is also about this problem : How to show public collection from google leaderboard with getLeaderboardIntent()?

By the way let's hope it will be corrected soon (or that I am wrong somewhere) !

这篇关于如何打开“全部”默认情况下,而不是“社交”在谷歌排行榜?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

07-30 12:20