Closed francichecco closed 2 months ago
@Abedalkareem We could easily return a LeaderboardScoreData
object that would contain the score, rank * more. Should we do so from getPlayerScore
or create a new method getPlayerScoreData
and encourage its use going forward?
There is no need to provide both individually as we are already retrieving the object with all of this information to just return the score value, and it would be wasteful to make extra network calls for data we have already retrieved.
@theLee3 @Abedalkareem
I actually implemented this about a year ago in a local modified version of this package, a method to retrieve a players score rank on leaderboards. I wanted to retrieve specifically by span - today, this week, all time - but getPlayerScore
is only fixed to allTime and, not wanting to mess with an existing method given I'm not very familiar with native development, I cut and paste code into a new method getPlayerScoreObject
that returns a fully populated LeaderboardScoreData
, including the rank, on both iOS and Android.
I have created a pull request that incorporates this and a few other potentially useful (and non-breaking?) enhancements I use. Feel free to pick apart and re-write, but hopefully use!
Thanks, I approved the PR can you fix the conflict and then we can merge it @theLee3 what do you think?
I resolved the conflict (I think! My first ever PR on another repo)
@egonbeermat That's awesome! Congrats on your first PR!
Thank you!
Great stuff @egonbeermat! Congrats!
Sorry I did not get involved before the PR was approved. Personal stuff got in the way. While I have not poured over the code committed, I have now used your work, including in part of my recent PR. As far as I can tell, everything works well.
@theLee3 Thanks! Glad it all appears to work for you! I understand completely about that pesky personal stuff :)
Added in #155
Actually the Player class has only this method
with that I can retrive the player score on a laderboard.
Could you add the method to retrive the player ranking on a laderboard ?
public abstract [String] getDisplayRank () <----------------------------------------- ADD THIS PLS
https://developers.google.com/android/reference/com/google/android/gms/games/leaderboard/LeaderboardScore