[Social] Specify a certain leaderboard id to show with Social.ShowLeaderboardUI?

Greetings,

I’m trying to port the social and IAP portions of our game from using 3rd party plugins to Unity’s Services API.

In the previous API we were using (from Stans Assets), the ShowLeaderboard function took a string identifier parameter for which leaderboard to show. Unity’s Social.ShowLeaderboardUI takes not parameters, it says it shows all the leaderboards for the game. Is there a way to tell it which leaderboard to show?

(Note that other functions such as ReportScore do seem to take a leaderboard parameter)

Thanks.

Looks like you can pass an ID with the call. From the docs…

Showing the Leaderboard UI
To show the built-in UI for all leaderboards, call Social.ShowLeaderboardUI.

using GooglePlayGames;
using UnityEngine.SocialPlatforms;

// show leaderboard UI
Social.ShowLeaderboardUI();

If you wish to show a particular leaderboard instead of all leaderboards, you can pass a leaderboard ID to the method. This, however, is a Play Games extension, so the Social.Active object needs to be cast to a PlayGamesPlatform object first:

using GooglePlayGames;
using UnityEngine.SocialPlatforms;

// show leaderboard UI
PlayGamesPlatform.Instance.ShowLeaderboardUI(“Cfji293fjsie_QA”);

1 Like

Ah I see, but what about GameCenter though? (Apple)

[Edit] It’s UnityEngine.SocialPlatforms.GameCenter.GameCenterPlatform.ShowLeaderboardUI(…)

1 Like

It kind of breaks the point of their ‘abstraction’ - What’s the point of the interface stuff if you’re going to have me call to the concrete implementation?

@jgodfrey_1 Which brings up the question: What about ReportScore/Progress? is Social.ReportProgress and Social.ReportScore sufficient or do we have to call the concrete versions as well?

Everything I know about this stuff is in the docs (README.md) here…

https://github.com/playgameservices/play-games-plugin-for-unity