I took a look into GooglePlayServicesExtension.java and it seems to me there's no implementation for showing a single leaderboard by its id.
I was able to add one following Google's
official guide though; there are 2 steps:
(1) Add a new method to GooglePlayServicesExtension.java (under extensions\GooglePlayServicesExtension\AndroidSource\Java); I called it gps_show_leaderboard, with content copied from onShowGSLeaderboards and mixed with official guide's code.
Code:
public void gps_show_leaderboard(String id)
{
if (isSignedIn()) {
RunnerActivity.CurrentActivity.startActivityForResult(Games.Leaderboards.getLeaderboardIntent(getApiClient(), id), RC_GPS_ACTIVITY);
}
else {
(new AlertDialog.Builder(RunnerActivity.CurrentActivity))
.setTitle("Leaderboard Not Available")
.setMessage("You can't view the leaderboard because you are not signed in.")
.setNeutralButton("OK", null)
.show();
}
}
(2) Add this function to GooglePlayServicesExtension -> Resources/File/
GooglePlayServicesExtension.ext -> Properties -> Functions
Name: gps_show_leaderboard (or whatever you wanted to call in gml)
External Name: gps_show_leaderboard (or whatever you named it in GooglePlayServicesExtension.java)
ReturnType: double
Argument: string
Note: I am no pro to Java, nor Android, nor GM:S2, just happened to be working on achievements recently, so please correct me if I did something wrong (e.g. What is RC_GPS_ACTIVITY ..?).
Unfortunately my mac died a couple days ago so I can't look into the iOS counterpart right now.
Do you guys mean achievement_load_leaderboard is working perfectly under iOS?