loadPlayerScoreObject for rank retrieval, and other enhancements #155
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
A user requested the ability to retrieve a players score rank. I had previously modified this package locally to add methods to do that, and it has been live for almost a year in my app. I have modified my local update to incorporate the latest change to use
PlayerData
and am offering up the code here (plus some other enhancements) for you to pull apart, change and incorporate if you wish! Details below:getPlayerScoreObject
to retrieve rank and other score data for leaderboard and time spantoken
to methods that submit and retrieve score. Can be used to store additional information or metadata about the score. Saved asscoreTag
(String) on Android,context
(Int) on iOS. Due to the difference in datatype between Android / iOS, I decided that while Int was 'safer' as the type (compatible with both), String offers more for Android-only implementations, and a documented note for iOS users to use Int that was converted to String on submission would sufficeshowsCompletionBanner
as parameter for iOSGKAchievement.report
, replacing hard-coded true. Defaults to trueresetAchievements
method for iOS only, Android doesn't support this through Play Games