Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

loadPlayerScoreObject for rank retrieval, and other enhancements #155

Merged
merged 3 commits into from
Jun 3, 2024
Merged

loadPlayerScoreObject for rank retrieval, and other enhancements #155

merged 3 commits into from
Jun 3, 2024

Conversation

egonbeermat
Copy link
Contributor

@egonbeermat egonbeermat commented Feb 19, 2024

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:

  • Add getPlayerScoreObject to retrieve rank and other score data for leaderboard and time span
  • Added optional String token to methods that submit and retrieve score. Can be used to store additional information or metadata about the score. Saved as scoreTag (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 suffice
  • Added optional Bool showsCompletionBanner as parameter for iOS GKAchievement.report, replacing hard-coded true. Defaults to true
  • Added resetAchievements method for iOS only, Android doesn't support this through Play Games
  • Update play-services-games version
  • Update play-services-auth version

- Add GetPlayerScoreObject to retrieve rank and other score data for leaderboard / time span
- Added optional String 'token' to score, to store additional score info/metadata. Saved as scoreTag (String) on Android, context (Int) on iOS
- Added optional showsCompletionBanner as parameter for report achievement, replace hard-coded true, default true
- Added resetAchievements, iOS only, Android doesn't support
- Update play-services-games
- Update play-services-auth
@theLee3
Copy link
Collaborator

theLee3 commented Feb 19, 2024

Thanks @egonbeermat. Some cool contributions here. I will look through the code asap.

@egonbeermat
Copy link
Contributor Author

@theLee3 Did you get a chance to review these changes yet?

@theLee3
Copy link
Collaborator

theLee3 commented Apr 6, 2024

@egonbeermat I am so sorry, I have not. I will make it a priority over the next few days.

Copy link
Owner

@Abedalkareem Abedalkareem left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@Abedalkareem
Copy link
Owner

Can you please fix the conflicts?

@Abedalkareem Abedalkareem merged commit 0e8d4bb into Abedalkareem:develop Jun 3, 2024
1 check failed
@egonbeermat egonbeermat deleted the feature_load_player_score_object branch June 3, 2024 21:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants